Part Number Hot Search : 
SP665906 08461 EER4220 STC89C52 DATAS SF2188C MAB8040 2SA1018
Product Description
Full Text Search
 

To Download MC68336 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters can and do vary in different applications. all operating parameters, including "typicals" must be validated for each customer application by customer's technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and ! are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/affirmative action employer. ?motorola, inc. 1996 toucan is a trademark of motorola, inc. MC68336/376 user? manual 336376umbook page 1 friday, november 15, 1996 2:09 pm
336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual iii paragraph title page section 1 introduction section 2 nomenclature 2.1 symbols and operators ............................................................................. 2-1 2.2 cpu32 registers ....................................................................................... 2-2 2.3 pin and signal mnemonics ........................................................................ 2-2 2.4 register mnemonics .................................................................................. 2-4 2.5 conventions .............................................................................................. 2-8 section 3 overview 3.1 mcu features ........................................................................................... 3-1 3.1.1 central processing unit (cpu32) ...................................................... 3-1 3.1.2 system integration module (sim) ...................................................... 3-1 3.1.3 standby ram module (sram) .......................................................... 3-1 3.1.4 masked rom module (mrm) ............................................................ 3-1 3.1.5 10-bit queued analog-to-digital converter (qadc) ......................... 3-2 3.1.6 queued serial module (qsm) ........................................................... 3-2 3.1.7 configurable timer module version 4 (ctm4) .................................. 3-2 3.1.8 time processor unit (tpu) ............................................................... 3-2 3.1.9 static ram module with tpu emulation capability (tpuram) ........ 3-2 3.1.10 can 2.0b controller module (toucan) ............................................ 3-3 3.2 intermodule bus ........................................................................................ 3-3 3.3 system block diagram and pin assignment diagrams ............................. 3-3 3.4 pin descriptions ........................................................................................ 3-6 3.5 signal descriptions .................................................................................... 3-9 3.6 internal register map .............................................................................. 3-13 3.7 address space maps .............................................................................. 3-14 section 4 central processor unit 4.1 general ...................................................................................................... 4-1 4.2 cpu32 registers ....................................................................................... 4-2 4.2.1 data registers ................................................................................... 4-4 4.2.2 address registers ............................................................................. 4-5 4.2.3 program counter ............................................................................... 4-6 4.2.4 control registers ............................................................................... 4-6 4.2.4.1 status register .......................................................................... 4-6 4.2.4.2 alternate function code registers ........................................... 4-7 4.2.5 vector base register (vbr) .............................................................. 4-7 4.3 memory organization ................................................................................ 4-7 table of contents 336376umbook page iii friday, november 15, 1996 2:09 pm
motorola MC68336/376 iv user? manual (continued) paragraph title page table of contents 4.4 virtual memory .......................................................................................... 4-9 4.5 addressing modes ..................................................................................... 4-9 4.6 processing states ..................................................................................... 4-9 4.7 privilege levels ....................................................................................... 4-10 4.8 instructions .............................................................................................. 4-10 4.8.1 m68000 family compatibility .......................................................... 4-14 4.8.2 special control instructions ............................................................. 4-14 4.8.2.1 low-power stop (lpstop) .................................................... 4-14 4.8.2.2 table lookup and interpolate (tbl) ....................................... 4-14 4.8.2.3 loop mode instruction execution ............................................ 4-15 4.9 exception processing .............................................................................. 4-15 4.9.1 exception vectors ........................................................................... 4-15 4.9.2 types of exceptions ........................................................................ 4-17 4.9.3 exception processing sequence ..................................................... 4-17 4.10 development support .............................................................................. 4-17 4.10.1 m68000 family development support ............................................ 4-18 4.10.2 background debug mode ................................................................ 4-18 4.10.3 enabling bdm ................................................................................. 4-19 4.10.4 bdm sources .................................................................................. 4-19 4.10.4.1 external bkpt signal .............................................................. 4-20 4.10.4.2 bgnd instruction .................................................................... 4-20 4.10.4.3 double bus fault ..................................................................... 4-20 4.10.4.4 peripheral breakpoints ............................................................ 4-20 4.10.5 entering bdm .................................................................................. 4-20 4.10.6 bdm commands ............................................................................. 4-21 4.10.7 background mode registers ........................................................... 4-22 4.10.7.1 fault address register (far) ................................................. 4-22 4.10.7.2 return program counter (rpc) .............................................. 4-22 4.10.7.3 current instruction program counter (pcc) ........................... 4-23 4.10.8 returning from bdm ........................................................................ 4-23 4.10.9 serial interface ................................................................................ 4-23 4.10.10 recommended bdm connection .................................................... 4-25 4.10.11 deterministic opcode tracking ....................................................... 4-26 4.10.12 on-chip breakpoint hardware ........................................................ 4-26 section 5 system integration module 5.1 general ...................................................................................................... 5-1 5.2 system configuration ................................................................................ 5-2 5.2.1 module mapping ................................................................................ 5-2 5.2.2 interrupt arbitration ............................................................................ 5-2 5.2.3 show internal cycles ......................................................................... 5-3 336376umbook page iv friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual v (continued) paragraph title page table of contents 5.2.4 register access ................................................................................ 5-3 5.2.5 freeze operation .............................................................................. 5-3 5.3 system clock ............................................................................................ 5-4 5.3.1 clock sources ................................................................................... 5-4 5.3.2 clock synthesizer operation ............................................................. 5-5 5.3.3 external bus clock .......................................................................... 5-12 5.3.4 low-power operation ...................................................................... 5-12 5.4 system protection ................................................................................... 5-14 5.4.1 reset status .................................................................................... 5-14 5.4.2 bus monitor ..................................................................................... 5-14 5.4.3 halt monitor ..................................................................................... 5-15 5.4.4 spurious interrupt monitor ............................................................... 5-15 5.4.5 software watchdog ......................................................................... 5-15 5.4.6 periodic interrupt timer ................................................................... 5-17 5.4.7 interrupt priority and vectoring ........................................................ 5-18 5.4.8 low-power stop mode operation ................................................. 5-19 5.5 external bus interface ............................................................................. 5-19 5.5.1 bus control signals ......................................................................... 5-21 5.5.1.1 address bus ............................................................................ 5-21 5.5.1.2 address strobe ....................................................................... 5-21 5.5.1.3 data bus ................................................................................. 5-21 5.5.1.4 data strobe ............................................................................. 5-22 5.5.1.5 read/write signal ................................................................... 5-22 5.5.1.6 size signals ............................................................................ 5-22 5.5.1.7 function codes ....................................................................... 5-22 5.5.1.8 data and size acknowledge signals ...................................... 5-23 5.5.1.9 bus error signal ...................................................................... 5-23 5.5.1.10 halt signal ............................................................................... 5-23 5.5.1.11 autovector signal .................................................................... 5-24 5.5.2 dynamic bus sizing ........................................................................ 5-24 5.5.3 operand alignment ......................................................................... 5-25 5.5.4 misaligned operands ...................................................................... 5-25 5.5.5 operand transfer cases ................................................................. 5-26 5.6 bus operation ......................................................................................... 5-26 5.6.1 synchronization to clkout ........................................................... 5-26 5.6.2 regular bus cycles ......................................................................... 5-27 5.6.2.1 read cycle .............................................................................. 5-28 5.6.2.2 write cycle .............................................................................. 5-29 5.6.3 fast termination cycles .................................................................. 5-30 5.6.4 cpu space cycles .......................................................................... 5-30 5.6.4.1 breakpoint acknowledge cycle ............................................... 5-31 336376umbook page v friday, november 15, 1996 2:09 pm
motorola MC68336/376 vi user? manual (continued) paragraph title page table of contents 5.6.4.2 lpstop broadcast cycle ....................................................... 5-34 5.6.5 bus exception control cycles ......................................................... 5-34 5.6.5.1 bus errors ............................................................................... 5-36 5.6.5.2 double bus faults ................................................................... 5-36 5.6.5.3 retry operation ....................................................................... 5-37 5.6.5.4 halt operation ......................................................................... 5-37 5.6.6 external bus arbitration ................................................................... 5-38 5.6.6.1 show cycles ........................................................................... 5-39 5.7 reset ....................................................................................................... 5-40 5.7.1 reset exception processing ........................................................... 5-40 5.7.2 reset control logic ......................................................................... 5-40 5.7.3 reset mode selection ..................................................................... 5-41 5.7.3.1 data bus mode selection ........................................................ 5-42 5.7.3.2 clock mode selection ............................................................. 5-44 5.7.3.3 breakpoint mode selection ..................................................... 5-45 5.7.4 mcu module pin function during reset ........................................ 5-45 5.7.5 pin states during reset .................................................................. 5-46 5.7.5.1 reset states of sim pins ........................................................ 5-46 5.7.5.2 reset states of pins assigned to other mcu modules .......... 5-47 5.7.6 reset timing ................................................................................... 5-47 5.7.7 power-on reset .............................................................................. 5-48 5.7.8 use of the three-state control pin ................................................. 5-49 5.7.9 reset processing summary ............................................................ 5-50 5.7.10 reset status register ..................................................................... 5-50 5.8 interrupts ................................................................................................. 5-50 5.8.1 interrupt exception processing ....................................................... 5-50 5.8.2 interrupt priority and recognition .................................................... 5-51 5.8.3 interrupt acknowledge and arbitration ............................................ 5-52 5.8.4 interrupt processing summary ........................................................ 5-53 5.8.5 interrupt acknowledge bus cycles .................................................. 5-54 5.9 chip-selects ............................................................................................ 5-54 5.9.1 chip-select registers ...................................................................... 5-57 5.9.1.1 chip-select pin assignment registers ................................... 5-57 5.9.1.2 chip-select base address registers ...................................... 5-58 5.9.1.3 chip-select option registers .................................................. 5-59 5.9.1.4 port c data register ............................................................... 5-60 5.9.2 chip-select operation ..................................................................... 5-60 5.9.3 using chip-select signals for interrupt acknowledge ..................... 5-61 5.9.4 chip-select reset operation ........................................................... 5-62 5.10 parallel input/output ports ...................................................................... 5-64 5.10.1 pin assignment registers ............................................................... 5-64 336376umbook page vi friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual vii (continued) paragraph title page table of contents 5.10.2 data direction registers ................................................................. 5-64 5.10.3 data registers ................................................................................. 5-64 5.11 factory test ............................................................................................ 5-64 section 6 standby ram module 6.1 sram register block ................................................................................ 6-1 6.2 sram array address mapping ................................................................. 6-1 6.3 sram array address space type ............................................................ 6-1 6.4 normal access .......................................................................................... 6-2 6.5 standby and low-power stop operation .................................................. 6-2 6.6 reset ......................................................................................................... 6-3 section 7 masked rom module 7.1 mrm register block .................................................................................. 7-1 7.2 mrm array address mapping ................................................................... 7-1 7.3 mrm array address space type .............................................................. 7-2 7.4 normal access .......................................................................................... 7-2 7.5 low-power stop mode operation ............................................................. 7-3 7.6 rom signature .......................................................................................... 7-3 7.7 reset ......................................................................................................... 7-3 section 8 queued analog-to-digital converter module 8.1 general ...................................................................................................... 8-1 8.2 qadc address map .................................................................................. 8-2 8.3 qadc registers ........................................................................................ 8-2 8.4 qadc pin functions ................................................................................. 8-2 8.4.1 port a pin functions .......................................................................... 8-3 8.4.1.1 port a analog input pins ........................................................... 8-4 8.4.1.2 port a digital input/output pins ................................................ 8-4 8.4.2 port b pin functions .......................................................................... 8-4 8.4.2.1 port b analog input pins ........................................................... 8-4 8.4.2.2 port b digital input pins ............................................................ 8-4 8.4.3 external trigger input pins ................................................................ 8-5 8.4.4 multiplexed address output pins ...................................................... 8-5 8.4.5 multiplexed analog input pins ........................................................... 8-5 8.4.6 voltage reference pins ..................................................................... 8-5 8.4.7 dedicated analog supply pins .......................................................... 8-6 8.4.8 external digital supply pin ................................................................ 8-6 8.4.9 digital supply pins ............................................................................ 8-6 336376umbook page vii friday, november 15, 1996 2:09 pm
motorola MC68336/376 viii user? manual (continued) paragraph title page table of contents 8.5 qadc bus interface .................................................................................. 8-6 8.6 module configuration ................................................................................ 8-6 8.6.1 low-power stop mode ...................................................................... 8-6 8.6.2 freeze mode ..................................................................................... 8-7 8.6.3 supervisor/unrestricted address space ........................................... 8-7 8.6.4 interrupt arbitration priority ............................................................... 8-8 8.7 test register ............................................................................................. 8-8 8.8 general-purpose i/o port operation ......................................................... 8-8 8.8.1 port data register ............................................................................. 8-9 8.8.2 port data direction register .............................................................. 8-9 8.9 external multiplexing operation .............................................................. 8-10 8.10 analog input channels ............................................................................ 8-12 8.11 analog subsystem .................................................................................. 8-12 8.11.1 conversion cycle times ................................................................. 8-13 8.11.1.1 amplifier bypass mode conversion timing ............................ 8-14 8.11.2 front-end analog multiplexer .......................................................... 8-15 8.11.3 digital to analog converter array .................................................... 8-15 8.11.4 comparator ..................................................................................... 8-16 8.11.5 successive approximation register ................................................ 8-16 8.12 digital control subsystem ....................................................................... 8-16 8.12.1 queue priority ................................................................................. 8-16 8.12.2 queue boundary conditions ........................................................... 8-19 8.12.3 scan modes .................................................................................... 8-20 8.12.3.1 disabled mode and reserved mode ....................................... 8-20 8.12.3.2 single-scan modes ................................................................. 8-20 8.12.3.3 continuous-scan modes ......................................................... 8-22 8.12.4 qadc clock (qclk) generation .................................................... 8-24 8.12.5 periodic/interval timer .................................................................... 8-27 8.12.6 control and status registers .......................................................... 8-28 8.12.6.1 control register 0 (qacr0) ................................................... 8-28 8.12.6.2 control register 1 (qacr1) ................................................... 8-28 8.12.6.3 control register 2 (qacr2) ................................................... 8-28 8.12.6.4 status register (qasr) .......................................................... 8-28 8.12.7 conversion command word table ................................................. 8-28 8.12.8 result word table ........................................................................... 8-31 8.13 interrupts ................................................................................................. 8-32 8.13.1 interrupt sources ............................................................................. 8-32 8.13.2 interrupt register ............................................................................. 8-32 8.13.3 interrupt vectors .............................................................................. 8-33 8.13.4 initializing the qadc for interrupt driven operation ....................... 8-34 section 9 queued serial module 336376umbook page viii friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual ix (continued) paragraph title page table of contents 9.1 general ...................................................................................................... 9-1 9.2 qsm registers and address map ............................................................. 9-2 9.2.1 qsm global registers ....................................................................... 9-2 9.2.1.1 low-power stop operation ....................................................... 9-2 9.2.1.2 freeze operation ...................................................................... 9-3 9.2.1.3 qsm interrupts .......................................................................... 9-3 9.2.2 qsm pin control registers ............................................................... 9-4 9.3 queued serial peripheral interface ........................................................... 9-5 9.3.1 qspi registers .................................................................................. 9-6 9.3.1.1 control registers ...................................................................... 9-6 9.3.1.2 status register .......................................................................... 9-7 9.3.2 qspi ram ......................................................................................... 9-7 9.3.2.1 receive ram ............................................................................ 9-7 9.3.2.2 transmit ram ........................................................................... 9-7 9.3.2.3 command ram ......................................................................... 9-8 9.3.3 qspi pins .......................................................................................... 9-8 9.3.4 qspi operation ................................................................................. 9-8 9.3.5 qspi operating modes ..................................................................... 9-9 9.3.5.1 master mode ........................................................................... 9-16 9.3.5.2 master wrap-around mode ..................................................... 9-19 9.3.5.3 slave mode ............................................................................. 9-19 9.3.5.4 slave wrap-around mode ....................................................... 9-20 9.3.6 peripheral chip selects ................................................................... 9-20 9.4 serial communication interface .............................................................. 9-21 9.4.1 sci registers .................................................................................. 9-21 9.4.1.1 control registers .................................................................... 9-21 9.4.1.2 status register ........................................................................ 9-24 9.4.1.3 data register .......................................................................... 9-24 9.4.2 sci pins .......................................................................................... 9-24 9.4.3 sci operation .................................................................................. 9-24 9.4.3.1 definition of terms .................................................................. 9-25 9.4.3.2 serial formats ......................................................................... 9-25 9.4.3.3 baud clock .............................................................................. 9-25 9.4.3.4 parity checking ....................................................................... 9-26 9.4.3.5 transmitter operation ............................................................. 9-26 9.4.3.6 receiver operation ................................................................. 9-28 9.4.3.7 idle-line detection .................................................................. 9-28 9.4.3.8 receiver wake-up .................................................................. 9-29 9.4.3.9 internal loop ........................................................................... 9-30 9.5 qsm initialization .................................................................................... 9-30 section 10 configurable timer module 4 336376umbook page ix friday, november 15, 1996 2:09 pm
motorola MC68336/376 x user? manual (continued) paragraph title page table of contents 10.1 general .................................................................................................... 10-1 10.2 address map ........................................................................................... 10-2 10.3 time base bus system ........................................................................... 10-2 10.4 bus interface unit submodule (biusm) .................................................. 10-3 10.4.1 stop effect on the biusm ............................................................ 10-3 10.4.2 freeze effect on the biusm ........................................................... 10-3 10.4.3 lpstop effect on the biusm ......................................................... 10-4 10.4.4 biusm registers ............................................................................. 10-4 10.5 counter prescaler submodule (cpsm) .................................................. 10-4 10.5.1 cpsm registers .............................................................................. 10-5 10.6 free-running counter submodule (fcsm) ............................................ 10-5 10.6.1 fcsm counter ................................................................................ 10-6 10.6.2 fcsm clock sources ...................................................................... 10-6 10.6.3 fcsm external event counting ...................................................... 10-6 10.6.4 fcsm time base bus driver .......................................................... 10-6 10.6.5 fcsm interrupts .............................................................................. 10-6 10.6.6 fcsm registers .............................................................................. 10-7 10.7 modulus counter submodule (mcsm) ................................................... 10-7 10.7.1 mcsm modulus latch ..................................................................... 10-8 10.7.2 mcsm counter ................................................................................ 10-8 10.7.2.1 loading the mcsm counter register ..................................... 10-8 10.7.2.2 using the mcsm as a free-running counter ........................ 10-9 10.7.3 mcsm clock sources ..................................................................... 10-9 10.7.4 mcsm external event counting ...................................................... 10-9 10.7.5 mcsm time base bus driver ......................................................... 10-9 10.7.6 mcsm interrupts ............................................................................. 10-9 10.7.7 mcsm registers ........................................................................... 10-10 10.8 double-action submodule (dasm) ....................................................... 10-10 10.8.1 dasm interrupts ............................................................................ 10-12 10.8.2 dasm registers ............................................................................ 10-12 10.9 pulse-width modulation submodule (pwmsm) .................................... 10-12 10.9.1 output flip-flop and pin ............................................................... 10-13 10.9.2 clock selection .............................................................................. 10-13 10.9.3 pwmsm counter .......................................................................... 10-14 10.9.4 pwmsm period registers and comparator .................................. 10-14 10.9.5 pwmsm pulse-width registers and comparator ......................... 10-15 10.9.6 pwmsm coherency ...................................................................... 10-15 10.9.7 pwmsm interrupts ........................................................................ 10-15 10.9.8 pwm frequency ............................................................................ 10-16 10.9.9 pwm pulse width ......................................................................... 10-17 10.9.10 pwm period and pulse width register values ............................. 10-17 336376umbook page x friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xi (continued) paragraph title page table of contents 10.9.10.1 pwm duty cycle boundary cases ....................................... 10-17 10.9.11 pwmsm registers ........................................................................ 10-17 10.10 ctm4 interrupts .................................................................................... 10-18 section 11 time processor unit 11.1 general .................................................................................................... 11-1 11.2 tpu components .................................................................................... 11-2 11.2.1 time bases ..................................................................................... 11-2 11.2.2 timer channels ............................................................................... 11-2 11.2.3 scheduler ........................................................................................ 11-3 11.2.4 microengine ..................................................................................... 11-3 11.2.5 host interface .................................................................................. 11-3 11.2.6 parameter ram ............................................................................... 11-3 11.3 tpu operation ........................................................................................ 11-3 11.3.1 event timing ................................................................................... 11-4 11.3.2 channel orthogonality ..................................................................... 11-4 11.3.3 interchannel communication ........................................................... 11-4 11.3.4 programmable channel service priority ......................................... 11-4 11.3.5 coherency ....................................................................................... 11-4 11.3.6 emulation support ........................................................................... 11-5 11.3.7 tpu interrupts ................................................................................. 11-5 11.4 a mask set time functions .................................................................... 11-6 11.4.1 discrete input/output (dio) ............................................................. 11-6 11.4.2 input capture/input transition counter (itc) .................................. 11-6 11.4.3 output compare (oc) ..................................................................... 11-7 11.4.4 pulse-width modulation (pwm) ...................................................... 11-7 11.4.5 synchronized pulse-width modulation (spwm) ............................. 11-7 11.4.6 period measurement with additional transition detect (pma) ....... 11-8 11.4.7 period measurement with missing transition detect (pmm) .......... 11-8 11.4.8 position-synchronized pulse generator (psp) ............................... 11-8 11.4.9 stepper motor (sm) ......................................................................... 11-9 11.4.10 period/pulse-width accumulator (ppwa) ....................................... 11-9 11.4.11 quadrature decode (qdec) ......................................................... 11-10 11.5 g mask set time functions .................................................................. 11-10 11.5.1 table stepper motor (tsm) ........................................................... 11-10 11.5.2 new input capture/transition counter (nitc) .............................. 11-11 11.5.3 queued output match (qom) ....................................................... 11-11 11.5.4 programmable time accumulator (pta) ...................................... 11-11 11.5.5 multichannel pulse-width modulation (mcpwm) ......................... 11-11 11.5.6 fast quadrature decode (fqd) .................................................... 11-12 11.5.7 universal asynchronous receiver/transmitter (uart) ................ 11-12 336376umbook page xi friday, november 15, 1996 2:09 pm
motorola MC68336/376 xii user? manual (continued) paragraph title page table of contents 11.5.8 brushless motor commutation (comm) ....................................... 11-12 11.5.9 frequency measurement (fqm) ................................................... 11-13 11.5.10 hall effect decode (halld) .......................................................... 11-13 11.6 host interface registers ........................................................................ 11-13 11.6.1 system configuration registers .................................................... 11-13 11.6.1.1 prescaler control for tcr1 ................................................... 11-13 11.6.1.2 prescaler control for tcr2 ................................................... 11-14 11.6.1.3 emulation control .................................................................. 11-15 11.6.1.4 low-power stop control ....................................................... 11-15 11.6.2 channel control registers ............................................................ 11-15 11.6.2.1 channel interrupt enable and status registers .................... 11-15 11.6.2.2 channel function select registers ....................................... 11-16 11.6.2.3 host sequence registers ..................................................... 11-16 11.6.2.4 host service registers .......................................................... 11-17 11.6.2.5 channel priority registers .................................................... 11-17 11.6.3 development support and test registers .................................... 11-17 section 12 standby ram with tpu emulation 12.1 general .................................................................................................... 12-1 12.2 tpuram register block ......................................................................... 12-1 12.3 tpuram array address mapping ........................................................... 12-1 12.4 tpuram privilege level ......................................................................... 12-2 12.5 normal operation .................................................................................... 12-2 12.6 standby operation .................................................................................. 12-2 12.7 low-power stop operation ..................................................................... 12-3 12.8 reset ....................................................................................................... 12-3 12.9 tpu microcode emulation ....................................................................... 12-3 section 13 can 2.0b controller module (toucan) 13.1 general .................................................................................................... 13-1 13.2 external pins ........................................................................................... 13-2 13.3 programmer? model ............................................................................... 13-2 13.4 toucan architecture .............................................................................. 13-3 13.4.1 tx/rx message buffer structure .................................................... 13-3 13.4.1.1 common fields for extended and standard format frames . 13-4 13.4.1.2 fields for extended format frames ........................................ 13-5 13.4.1.3 fields for standard format frames ........................................ 13-5 13.4.1.4 serial message buffers ........................................................... 13-6 13.4.1.5 message buffer activation/deactivation mechanism .............. 13-6 13.4.1.6 message buffer lock/release/busy mechanism .................... 13-6 336376umbook page xii friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xiii (continued) paragraph title page table of contents 13.4.2 receive mask registers .................................................................. 13-7 13.4.3 bit timing ........................................................................................ 13-8 13.4.3.1 configuring the toucan bit timing ........................................ 13-9 13.4.4 error counters ................................................................................. 13-9 13.4.5 time stamp ................................................................................... 13-10 13.5 toucan operation ................................................................................ 13-11 13.5.1 toucan reset .............................................................................. 13-11 13.5.2 toucan initialization ..................................................................... 13-11 13.5.3 transmit process .......................................................................... 13-12 13.5.3.1 transmit message buffer deactivation ................................. 13-13 13.5.3.2 reception of transmitted frames ......................................... 13-13 13.5.4 receive process ........................................................................... 13-13 13.5.4.1 receive message buffer deactivation .................................. 13-14 13.5.4.2 locking and releasing message buffers .............................. 13-15 13.5.5 remote frames ............................................................................. 13-15 13.5.6 overload frames ........................................................................... 13-16 13.6 special operating modes ...................................................................... 13-16 13.6.1 debug mode .................................................................................. 13-16 13.6.2 low-power stop mode .................................................................. 13-17 13.6.3 auto power save mode ................................................................. 13-18 13.7 interrupts ............................................................................................... 13-19 appendix a electrical characteristics appendix b mechanical data and ordering information b.1 obtaining updated MC68336/376 mechanical information ...................... b-4 b.2 ordering information ................................................................................ b-4 appendix c development support c.1 m68mmds1632 modular development system ...................................... c-1 c.2 m68mevb1632 modular evaluation board .............................................. c-1 appendix d register summary d.1 central processor unit ............................................................................. d-1 d.1.1 cpu32 register model ..................................................................... d-2 d.1.2 status register ................................................................................. d-3 d.2 system integration module ....................................................................... d-5 d.2.1 sim configuration register .............................................................. d-6 d.2.2 system integration test register ..................................................... d-7 336376umbook page xiii friday, november 15, 1996 2:09 pm
motorola MC68336/376 xiv user? manual (continued) paragraph title page table of contents d.2.3 clock synthesizer control register .................................................. d-8 d.2.4 reset status register ...................................................................... d-9 d.2.5 system integration test register (eclk) ........................................ d-9 d.2.6 port e data register ...................................................................... d-10 d.2.7 port e data direction register ....................................................... d-10 d.2.8 port e pin assignment register ..................................................... d-10 d.2.9 port f data register ....................................................................... d-11 d.2.10 port f data direction register ....................................................... d-11 d.2.11 port f pin assignment register ..................................................... d-11 d.2.12 system protection control register ............................................... d-12 d.2.13 periodic interrupt control register ................................................. d-13 d.2.14 periodic interrupt timer register ................................................... d-14 d.2.15 software watchdog service register ............................................. d-14 d.2.16 port c data register ...................................................................... d-15 d.2.17 chip-select pin assignment registers ........................................... d-15 d.2.18 chip-select base address register boot rom ............................. d-17 d.2.19 chip-select base address registers ............................................. d-17 d.2.20 chip-select option register boot rom ......................................... d-18 d.2.21 chip-select option registers ......................................................... d-18 d.2.22 master shift registers .................................................................... d-21 d.2.23 test module shift count register .................................................. d-21 d.2.24 test module repetition count register ......................................... d-21 d.2.25 test submodule control register .................................................. d-21 d.2.26 distributed register ........................................................................ d-21 d.3 standby ram module ............................................................................ d-22 d.3.1 ram module configuration register .............................................. d-22 d.3.2 ram test register ......................................................................... d-23 d.3.3 array base address register high ................................................. d-23 d.3.4 array base address register low ................................................. d-23 d.4 masked rom module ............................................................................. d-24 d.4.1 masked rom module configuration register ................................ d-24 d.4.2 rom array base address register high ....................................... d-26 d.4.3 rom array base address register low ........................................ d-26 d.4.4 rom signature high register ........................................................ d-26 d.4.5 rom signature low register ......................................................... d-26 d.4.6 rom bootstrap words ................................................................... d-27 d.5 qadc module ........................................................................................ d-28 d.5.1 qadc module configuration register ........................................... d-28 d.5.2 qadc test register ....................................................................... d-29 d.5.3 qadc interrupt register ................................................................ d-29 d.5.4 port a/b data register ................................................................... d-30 336376umbook page xiv friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xv (continued) paragraph title page table of contents d.5.5 port data direction register ........................................................... d-30 d.5.6 qadc control registers ................................................................ d-31 d.5.7 qadc status register ................................................................... d-35 d.5.8 conversion command word table ................................................ d-37 d.5.9 result word table .......................................................................... d-39 d.6 queued serial module ............................................................................ d-40 d.6.1 qsm configuration register .......................................................... d-40 d.6.2 qsm test register ......................................................................... d-41 d.6.3 qsm interrupt level register ......................................................... d-41 d.6.4 qsm interrupt vector register ....................................................... d-42 d.6.5 sci control register ...................................................................... d-42 d.6.7 sci status register ........................................................................ d-45 d.6.8 sci data register .......................................................................... d-46 d.6.9 port qs data register .................................................................... d-46 d.6.10 port qs pin assignment register/data direction register ............ d-47 d.6.11 qspi control register 0 ................................................................. d-48 d.6.12 qspi control register 1 ................................................................. d-50 d.6.13 qspi control register 2 ................................................................. d-51 d.6.14 qspi control register 3 ................................................................. d-52 d.6.15 qspi status register ..................................................................... d-53 d.6.16 receive data ram ......................................................................... d-53 d.6.17 transmit data ram ........................................................................ d-54 d.6.18 command ram .............................................................................. d-54 d.7 configurable timer module 4 ................................................................. d-56 d.7.1 biu module configuration register ................................................ d-57 d.7.2 biusm test configuration register ............................................... d-58 d.7.3 biusm time base register ........................................................... d-58 d.7.4 cpsm control register .................................................................. d-58 d.7.5 cpsm test register ....................................................................... d-59 d.7.6 fcsm status/interrupt/control register ......................................... d-59 d.7.7 fcsm counter register ................................................................. d-61 d.7.8 mcsm status/interrupt/control registers ...................................... d-61 d.7.9 mcsm counter registers .............................................................. d-63 d.7.10 mcsm modulus latch registers .................................................... d-63 d.7.11 dasm status/interrupt/control registers ....................................... d-63 d.7.12 dasm data register a ................................................................... d-66 d.7.13 dasm data register b ................................................................... d-67 d.7.14 pwm status/interrupt/control register .......................................... d-68 d.7.15 pwm period register ..................................................................... d-71 d.7.16 pwm pulse width register ............................................................ d-71 d.7.17 pwm counter register .................................................................. d-72 336376umbook page xv friday, november 15, 1996 2:09 pm
motorola MC68336/376 xvi user? manual (continued) paragraph title page table of contents d.8 time processor unit (tpu) .................................................................... d-73 d.8.1 tpu module configuration register ............................................... d-73 d.8.2 test configuration register ............................................................ d-75 d.8.3 development support control register .......................................... d-75 d.8.4 development support status register ........................................... d-76 d.8.5 tpu interrupt configuration register ............................................. d-77 d.8.6 channel interrupt enable register ................................................. d-77 d.8.7 channel function select registers ................................................ d-78 d.8.8 host sequence registers ............................................................... d-78 d.8.9 host service request registers .................................................... d-79 d.8.10 channel priority registers .............................................................. d-79 d.8.11 channel interrupt status register .................................................. d-80 d.8.12 link register .................................................................................. d-80 d.8.13 service grant latch register ......................................................... d-80 d.8.14 decoded channel number register .............................................. d-80 d.8.15 tpu parameter ram ..................................................................... d-80 d.9 standby ram module with tpu emulation capability (tpuram) ........ d-82 d.9.1 tpuram module configuration register ....................................... d-82 d.9.2 tpuram test register .................................................................. d-82 d.9.3 tpuram module configuration register ....................................... d-82 d.10 toucan module ..................................................................................... d-84 d.10.1 toucan module configuration register ........................................ d-85 d.10.2 toucan test configuration register ............................................. d-88 d.10.3 toucan interrupt configuration register ...................................... d-88 d.10.4 control register 0 .......................................................................... d-88 d.10.5 control register 1 .......................................................................... d-90 d.10.6 prescaler divide register ............................................................... d-91 d.10.7 control register 2 .......................................................................... d-91 d.10.8 free running timer ....................................................................... d-92 d.10.9 receive global mask registers ..................................................... d-93 d.10.10 receive buffer 14 mask registers ................................................. d-93 d.10.11 receive buffer 15 mask registers ................................................. d-93 d.10.12 error and status register ............................................................... d-94 d.10.13 interrupt mask register .................................................................. d-96 d.10.14 interrupt flag register .................................................................... d-96 d.10.15 error counters ................................................................................ d-97 336376umbook page xvi friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xvii figure title page 3-1 MC68336/376 block diagram ........................................................................ 3-4 3-2 MC68336 pin assignments for 160-pin package .......................................... 3-5 3-3 mc68376 pin assignments for 160-pin package .......................................... 3-6 3-4 MC68336/376 address map ......................................................................... 3-13 3-5 overall memory map .................................................................................... 3-15 3-6 separate supervisor and user space map .................................................. 3-16 3-7 supervisor space (separate program/data space) map ............................ 3-17 3-8 user space (separate program/data space) map ...................................... 3-18 4-1 cpu32 block diagram ................................................................................... 4-2 4-2 user programming model .............................................................................. 4-3 4-3 supervisor programming model supplement ................................................. 4-4 4-4 data organization in data registers .............................................................. 4-5 4-5 address organization in address registers ................................................... 4-6 4-6 memory operand addressing ........................................................................ 4-8 4-7 loop mode instruction sequence ................................................................. 4-15 4-8 common in-circuit emulator diagram ......................................................... 4-19 4-9 bus state analyzer configuration ................................................................ 4-19 4-10 debug serial i/o block diagram .................................................................. 4-24 4-11 bdm serial data word ................................................................................. 4-25 4-12 bdm connector pinout ................................................................................. 4-25 5-1 system integration module block diagram .................................................... 5-2 5-2 system clock block diagram ......................................................................... 5-4 5-3 system clock oscillator circuit ...................................................................... 5-5 5-4 system clock filter networks ........................................................................ 5-6 5-5 lpstop flowchart ....................................................................................... 5-13 5-6 system protection block .............................................................................. 5-14 5-7 periodic interrupt timer and software watchdog timer .............................. 5-17 5-8 mcu basic system ...................................................................................... 5-20 5-9 operand byte order ..................................................................................... 5-25 5-10 word read cycle flowchart ......................................................................... 5-28 5-11 write cycle flowchart .................................................................................. 5-29 5-12 cpu space address encoding .................................................................... 5-31 5-13 breakpoint operation flowchart ................................................................... 5-33 5-14 lpstop interrupt mask level ...................................................................... 5-34 5-15 bus arbitration flowchart for single request ............................................... 5-39 5-16 preferred circuit for data bus mode select conditioning ............................ 5-43 5-17 alternate circuit for data bus mode select conditioning ............................. 5-44 5-18 power-on reset ........................................................................................... 5-49 5-19 basic mcu system ...................................................................................... 5-55 5-20 chip-select circuit block diagram ............................................................... 5-56 5-21 cpu space encoding for interrupt acknowledge ......................................... 5-61 list of illustrations 336376umbook page xvii friday, november 15, 1996 2:09 pm
motorola MC68336/376 xviii user? manual (continued) figure title page list of illustrations 8-1 qadc block diagram ..................................................................................... 8-1 8-2 qadc input and output signals .................................................................... 8-3 8-3 example of external multiplexing ................................................................. 8-11 8-4 qadc module block diagram ...................................................................... 8-13 8-5 conversion timing ....................................................................................... 8-14 8-6 bypass mode conversion timing ................................................................. 8-15 8-7 qadc queue operation with pause ............................................................ 8-18 8-8 qadc clock subsystem functions .............................................................. 8-24 8-9 qadc clock programmability examples ..................................................... 8-26 8-10 qadc conversion queue operation ........................................................... 8-29 8-11 qadc interrupt vector format ..................................................................... 8-33 9-1 qsm block diagram ....................................................................................... 9-1 9-2 qspi block diagram ...................................................................................... 9-5 9-3 qspi ram ...................................................................................................... 9-7 9-4 flowchart of qspi initialization operation .................................................... 9-10 9-5 flowchart of qspi master operation (part 1) .............................................. 9-11 9-6 flowchart of qspi master operation (part 2) .............................................. 9-12 9-7 flowchart of qspi master operation (part 3) .............................................. 9-13 9-8 flowchart of qspi slave operation (part 1) ................................................ 9-14 9-9 flowchart of qspi slave operation (part 2) ................................................ 9-15 9-10 sci transmitter block diagram .................................................................... 9-22 9-11 sci receiver block diagram ........................................................................ 9-23 10-1 ctm4 block diagram ................................................................................... 10-1 10-2 cpsm block diagram ................................................................................... 10-4 10-3 fcsm block diagram ................................................................................... 10-5 10-4 mcsm block diagram .................................................................................. 10-8 10-5 dasm block diagram ................................................................................. 10-11 10-6 pulse-width modulation submodule block diagram .................................. 10-13 11-1 tpu block diagram ...................................................................................... 11-1 11-2 tcr1 prescaler control ............................................................................. 11-14 11-3 tcr2 prescaler control ............................................................................. 11-14 13-1 toucan block diagram ............................................................................... 13-1 13-2 typical can network ................................................................................... 13-2 13-3 extended id message buffer structure ........................................................ 13-3 13-4 standard id message buffer structure ........................................................ 13-4 13-5 toucan interrupt vector generation ......................................................... 13-19 a-1 clkout output timing diagram ................................................................. a-10 a-2 external clock input timing diagram ........................................................... a-10 a-3 eclk output timing diagram ...................................................................... a-10 a-4 read cycle timing diagram ........................................................................ a-11 a-5 write cycle timing diagram ......................................................................... a-12 336376umbook page xviii friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xix (continued) figure title page list of illustrations a-6 fast termination read cycle timing diagram ............................................ a-13 a-7 fast termination write cycle timing diagram ............................................. a-14 a-8 bus arbitration timing diagram ?active bus case ................................... a-15 a-9 bus arbitration timing diagram ?idle bus case ....................................... a-16 a-10 show cycle timing diagram ........................................................................ a-17 a-11 chip-select timing diagram ........................................................................ a-18 a-12 reset and mode select timing diagram ...................................................... a-18 a-13 background debugging mode timing ?serial communication ................. a-20 a-14 background debugging mode timing ?freeze assertion ......................... a-20 a-15 eclk timing diagram .................................................................................. a-22 a-16 qspi timing ?master, cpha = 0 .............................................................. a-24 a-17 qspi timing ?master, cpha = 1 .............................................................. a-24 a-18 qspi timing ?slave, cpha = 0 ................................................................ a-25 a-19 qspi timing ?slave, cpha = 1 ................................................................ a-25 a-20 tpu timing diagram .................................................................................... a-26 b-1 MC68336 pin assignments for 160-pin package .......................................... b-1 b-2 mc68376 pin assignments for 160-pin package .......................................... b-2 b-3 160-pin package dimensions ........................................................................ b-3 d-1 user programming model ..............................................................................d-2 d-2 supervisor programming model supplement .................................................d-3 d-3 toucan message buffer address map .......................................................d-85 336376umbook page xix friday, november 15, 1996 2:09 pm
motorola MC68336/376 xx user? manual (continued) figure title page list of illustrations 336376umbook page xx friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xxi table title page 3-1 MC68336/376 pin characteristics................................................................... 3-7 3-2 MC68336/376 output driver types................................................................. 3-8 3-3 MC68336/376 power connections.................................................................. 3-8 3-4 MC68336/376 signal characteristics .............................................................. 3-9 3-5 MC68336/376 signal functions .................................................................... 3-11 4-1 unimplemented mc68020 instructions ......................................................... 4-10 4-2 instruction set summary ............................................................................... 4-11 4-3 exception vector assignments...................................................................... 4-16 4-4 bdm source summary.................................................................................. 4-20 4-5 polling the bdm entry source....................................................................... 4-21 4-6 background mode command summary ....................................................... 4-22 4-7 cpu generated message encoding ............................................................. 4-25 5-1 show cycle enable bits .................................................................................. 5-3 5-2 clock control multipliers.................................................................................. 5-8 5-3 system frequencies from 4.194 mhz reference ......................................... 5-10 5-4 bus monitor period........................................................................................ 5-15 5-5 modclk pin and swp bit during reset ..................................................... 5-16 5-6 software watchdog ratio.............................................................................. 5-16 5-7 modclk pin and ptp bit at reset .............................................................. 5-17 5-8 periodic interrupt priority............................................................................... 5-18 5-9 size signal encoding .................................................................................... 5-22 5-10 address space encoding ............................................................................. 5-23 5-11 effect of dsack signals ............................................................................... 5-24 5-12 operand alignment ....................................................................................... 5-26 5-13 dsack, berr, and halt assertion results............................................... 5-35 5-14 reset source summary ................................................................................ 5-41 5-15 reset mode selection ................................................................................... 5-42 5-16 module pin functions during reset.............................................................. 5-46 5-17 sim pin reset states .................................................................................... 5-47 5-18 chip-select pin functions ............................................................................. 5-57 5-19 pin assignment field encoding..................................................................... 5-58 5-20 block size encoding...................................................................................... 5-59 5-21 chip-select base and option register reset values ................................... 5-63 5-22 csboot base and option register reset values....................................... 5-63 6-1 sram array address space type .................................................................. 6-2 7-1 rom array space type .................................................................................. 7-2 7-2 wait states field ............................................................................................. 7-2 8-1 multiplexed analog input channels................................................................. 8-5 8-2 analog input channels .................................................................................. 8-12 8-3 queue 1 priority assertion ............................................................................ 8-17 8-4 qadc clock programmability ....................................................................... 8-27 list of tables 336376umbook page xxi friday, november 15, 1996 2:09 pm
motorola MC68336/376 xxii user? manual (continued) table title page list of tables 8-5 qadc status flags and interrupt sources ................................................... 8-32 9-1 effect of ddrqs on qsm pin function .......................................................... 9-4 9-2 qspi pins........................................................................................................ 9-8 9-3 bits per transfer ........................................................................................... 9-17 9-4 sci pins ........................................................................................................ 9-24 9-5 serial frame formats.................................................................................... 9-25 9-6 effect of parity checking on data size ......................................................... 9-26 10-1 ctm4 time base bus allocation................................................................... 10-3 10-2 dasm modes of operation ......................................................................... 10-10 10-3 channel b data register access ................................................................ 10-11 10-4 pwmsm divide by options......................................................................... 10-14 10-5 pwm pulse and frequency ranges (in hz) using ? 2 option (20.97 mhz)10-16 10-6 pwm pulse and frequency ranges (in hz) using ? 3 option (20.97 mhz)10-16 10-7 ctm4 interrupt priority and vector/pin allocation....................................... 10-18 11-1 tcr1 prescaler control .............................................................................. 11-14 11-2 tcr2 prescaler control .............................................................................. 11-15 11-3 tpu function encodings............................................................................. 11-16 11-4 channel priority encodings ......................................................................... 11-17 13-1 common extended/standard format frames .............................................. 13-4 13-2 message buffer codes for receive buffers .................................................. 13-4 13-3 message buffer codes for transmit buffers ................................................. 13-5 13-4 extended format frames.............................................................................. 13-5 13-5 standard format frames .............................................................................. 13-6 13-6 receive mask register bit values ................................................................ 13-7 13-7 mask examples for normal/extended messages.......................................... 13-8 13-8 example system clock, can bit rate and s-clock frequencies................. 13-9 13-9 interrupt sources and vector addresses .................................................... 13-20 a-1 maximum ratings........................................................................................... a-1 a-2 typical ratings............................................................................................... a-2 a-3 thermal characteristics ................................................................................. a-2 a-4 clock control timing ...................................................................................... a-3 a-5 dc characteristics ......................................................................................... a-4 a-6 ac timing...................................................................................................... a-7 a-7 background debug mode timing................................................................. a-19 a-8 eclk bus timing ......................................................................................... a-21 a-9 qspi timing ................................................................................................. a-23 a-10 time processor unit timing ......................................................................... a-26 a-11 qadc maximum ratings ............................................................................. a-27 a-12 qadc dc electrical characteristics (operating) ......................................... a-28 a-13 qadc ac electrical characteristics (operating) ......................................... a-29 a-14 qadc conversion characteristics (operating)............................................ a-30 336376umbook page xxii friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual xxiii (continued) table title page list of tables a-15 fcsm timing characteristics....................................................................... a-31 a-16 mcsm timing characteristics...................................................................... a-31 a-17 sasm timing characteristics....................................................................... a-32 a-18 dasm timing characteristics ...................................................................... a-33 a-19 pwmsm timing characteristics................................................................... a-34 b-1 MC68336 ordering information...................................................................... b-4 b-2 mc68376 ordering information...................................................................... b-5 d-1 module address map .....................................................................................d-1 d-2 t[1:0] encoding ..............................................................................................d-3 d-3 sim address map...........................................................................................d-5 d-4 show cycle enable bits .................................................................................d-7 d-5 port e pin assignments................................................................................d-11 d-6 port f pin assignments................................................................................d-12 d-7 software watchdog timing field .................................................................d-13 d-8 bus monitor time-out period.......................................................................d-13 d-9 pin assignment field encoding....................................................................d-15 d-10 cspar0 pin assignments ...........................................................................d-16 d-11 cspar1 pin assignments ...........................................................................d-16 d-12 reset pin function of cs[10:6] ....................................................................d-17 d-13 block size field bit encoding.......................................................................d-18 d-14 byte field bit encoding ..............................................................................d-19 d-15 read/write field bit encoding .....................................................................d-19 d-16 dsack field encoding ................................................................................d-20 d-17 address space bit encodings ......................................................................d-20 d-18 interrupt priority level field encoding .........................................................d-20 d-19 sram address map.....................................................................................d-22 d-20 rasp encoding............................................................................................d-22 d-21 mrm address map.......................................................................................d-24 d-22 rom array space field ...............................................................................d-25 d-23 wait states field ..........................................................................................d-25 d-24 qadc address map.....................................................................................d-28 d-25 queue 1 operating modes ...........................................................................d-32 d-26 queue 2 operating modes ...........................................................................d-34 d-27 queue status ...............................................................................................d-36 d-28 input sample times .....................................................................................d-37 d-29 non-multiplexed channel assignments and pin designations ....................d-38 d-30 multiplexed channel assignments and pin designations ............................d-38 d-31 qsm address map .......................................................................................d-40 d-32 pqspar pin assignments...........................................................................d-47 d-33 effect of ddrqs on qsm pin function .......................................................d-48 d-34 bits per transfer ..........................................................................................d-49 336376umbook page xxiii friday, november 15, 1996 2:09 pm
motorola MC68336/376 xxiv user? manual (continued) table title page list of tables d-35 ctm4 address map .....................................................................................d-56 d-36 interrupt vector base number bit field........................................................d-57 d-37 time base register bus select bits.............................................................d-58 d-38 prescaler division ratio select field ...........................................................d-59 d-39 drive time base bus field...........................................................................d-60 d-40 counter clock select field...........................................................................d-60 d-41 drive time base bus field...........................................................................d-62 d-42 modulus load edge sensitivity bits .............................................................d-62 d-43 counter clock select field...........................................................................d-62 d-44 dasm mode flag status bit states .............................................................d-64 d-45 edge polarity ................................................................................................d-65 d-46 dasm mode select field .............................................................................d-66 d-47 dasma operations ......................................................................................d-67 d-48 dasmb operations ......................................................................................d-68 d-49 pwmsm output pin polarity selection ........................................................d-70 d-50 pwmsm divide by options..........................................................................d-71 d-51 tpu register map........................................................................................d-73 d-52 tcr1 prescaler control bits ........................................................................d-74 d-53 tcr2 prescaler control bits ........................................................................d-74 d-54 frz[1:0] encoding .......................................................................................d-76 d-55 breakpoint enable bits .................................................................................d-76 d-56 channel priorities .........................................................................................d-80 d-57 parameter ram address map .....................................................................d-81 d-58 tpuram address map ................................................................................d-82 d-59 toucan address map .................................................................................d-84 d-60 rx mode[1:0] configuration .......................................................................d-89 d-61 transmit pin configuration...........................................................................d-89 d-62 transmit bit error status ..............................................................................d-94 d-63 fault confinement state encoding...............................................................d-95 336376umbook page xxiv friday, november 15, 1996 2:09 pm
MC68336/376 introduction motorola user? manual 1-1 section 1 introduction the MC68336 and the mc68376 are highly-integrated 32-bit microcontrollers, com- bining high-performance data manipulation capabilities with powerful peripheral subsystems. mc68300 microcontrollers are built up from standard modules that interface through a common intermodule bus (imb). standardization facilitates rapid development of devices tailored for specific applications. the MC68336 incorporates a 32-bit cpu (cpu32), a system integration module (sim), a time processor unit (tpu), a configurable timer module (ctm4), a queued serial module (qsm), a 10-bit queued analog-to-digital converter module (qadc), a 3.5-kbyte tpu emulation ram module (tpuram), and a 4-kbyte standby ram module (sram). the mc68376 includes all of the aforementioned modules, plus a can 2.0b protocol controller module (toucan) and an 8-kbyte masked rom (mrm). the MC68336/376 can either synthesize the system clock signal from a fast reference or use an external clock input directly. operation with a 4.194 mhz reference frequen- cy is standard. the maximum system clock speed is 20.97 mhz. system hardware and software allow changes in clock rate during operation. because mcu operation is fully static, register and memory contents are not affected by clock rate changes. high-density complementary metal-oxide semiconductor (hcmos) architecture makes the basic power consumption of the mcu low. power consumption can be min- imized by stopping the system clock. the cpu32 instruction set includes a low-power stop (lpstop) instruction that efficiently implements this capability. documentation for the modular microcontroller family follows the modular construc- tion of the devices in the product line. each microcontroller has a comprehensive user's manual that provides sufficient information for normal operation of the device. the user's manual is supplemented by module reference manuals that provide de- tailed information about module operation and applications. refer to motorola publica- tion advanced microcontroller unit (amcu) literature (br1116/d) for a complete listing of documentation. 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola introduction MC68336/376 1-2 user? manual 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 nomenclature motorola user? manual 2-1 section 2 nomenclature the following nomenclature is used throughout the manual. nomenclature used only in certain sections, such as register bit mnemonics, is defined in those sections. 2.1 symbols and operators + ? addition - ? subtraction or negation (two's complement) * ? multiplication / ? division > ? greater < ? less = ? equal 3 ? equal or greater ? equal or less 1 ? not equal ? and ; ? inclusive or (or) ? ? exclusive or (eor) not ? complementation : ? concatenation t ? transferred ? ? exchanged ? sign bit; also used to show tolerance ? ? sign extension % ? binary value $ ? hexadecimal value 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola nomenclature MC68336/376 2-2 user? manual 2.2 cpu32 registers 2.3 pin and signal mnemonics a6?0 address registers (index registers) a7 (ssp) supervisor stack pointer a7 (usp) user stack pointer ccr condition code register (user portion of sr) d7?0 data registers (index registers) dfc ? alternate function code register pc program counter sfc alternate function code register sr status register vbr vector base register x extend indicator n negative indicator z zero indicator v two? complement overflow indicator c carry/borrow indicator addr[23:0] address bus an[59:48]/[3:0] qadc analog input an[w, x, y, z] qadc analog input as address strobe avec autovector berr bus error bg bus grant bgack bus grant acknowledge bkpt breakpoint br bus request canrx0 toucan receive data cantx0 toucan transmit data clkout system clock cs[10:0] chip selects csboot boot rom chip select cpwm[8:5] ctm pulse width modulation channel ctd[10:9]/[4:3] ctm double action channel ctm2c ctm modulus clock data[15:0] data bus ds data strobe 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 nomenclature motorola user? manual 2-3 dsack[1:0] data and size acknowledge dsclk development serial clock dsi development serial input dso development serial output eclk mc6800 devices and peripherals bus clock etrig[2:1] qadc external trigger extal crystal oscillator input fc[2:0] function codes freeze freeze halt halt ifetch instruction fetch ipipe instruction pipeline irq[7:1] interrupt request ma[2:0] qadc multiplexed address miso qsm master in slave out modclk clock mode select mosi qsm master out slave in pcs[3:0] qsm peripheral chip-selects pqa[7:0] qadc port a pqb[7:0] qadc port b pc[6:0] sim port c pe[7:0] sim port e pf[7:0] sim port f quot quotient out r/w read/write reset reset rmc read-modify-write cycle rxd sci receive data sck qspi serial clock siz[1:0] size ss slave select t2clk tpu clock in tpuch[15:0] tpu channel signals tsc three-state control tstme test mode enable v rh qadc high reference voltage v rl qadc low reference voltage xfc external filter capacitor xtal crystal oscillator output 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola nomenclature MC68336/376 2-4 user? manual 2.4 register mnemonics biumcr ctm4 biusm module configuration biutest ctm4 biusm test register biutbr ctm4 biusm time base register canctrl[0:2] toucan control register [0:2] canicr toucan interrupt configuration register iflag toucan interrupt flags register imask toucan interrupt masks register canmcr toucan module configuration register cantcr toucan test configuration register ccw[0:27] qadc command conversion words [0:27] cfsr[0:3] tpu channel function select registers [0:3] cier tpu channel interrupt enable register cisr tpu channel interrupt status register cpcr ctm4 cpsm control register cpr[0:1] tpu channel priority registers [0:1] cptr ctm4 cpsm test register cr[0:f] qsm command ram creg sim test control register c csbarbt sim chip-select base address register boot rom csbar[0:10] sim chip-select base address registers [0:10] csorbt sim chip-select option register boot rom csor[0:10] sim chip-select option registers [0:10] cspar[0:1] sim chip-select pin assignment registers [0:1] dasm[3:4]/[9:10]a ctm4 dasm a registers [3:4]/[9:10] dasm[3:4]/[9:10]b ctm4 dasm b registers [3:4]/[9:10] dasm[3:4]/[9:10]sic ctm4 dasm status/interrupt/control registers [3:4]/[9:10] dcnr decoded channel number register ddre sim port e data direction register ddrf sim port f data direction register ddrqa qadc port a data direction register ddrqs qsm port qs data direction register dreg sim test module distributed register dscr tpu development support control register dssr tpu development support status register estat toucan error and status register 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 nomenclature motorola user? manual 2-5 fcsm12cnt ctm4 fcsm12 counter register fcsm12sic ctm4 fcsm12 status/interrupt/control register hsqr[0:1] tpu host sequence registers [0:1] hsrr[0:1] tpu host service request registers [0:1] ljsrr[0:27] qadc left-justified signed result registers [0:27] ljurr[0:27] qadc left-justified unsigned result registers [0:27] lr link register mcsm[2]/[11]cnt ctm4 mcsm counter registers [2]/[11] mcsm[2]/[11]ml ctm4 mcsm modulus latch registers [2]/[11] mcsm[2]/[11]sic ctm4 mcsm status/interrupt/control registers [2]/[11] mrmcr masked rom module configuration register pepar sim port e pin assignment register pfpar sim port f pin assignment register picr sim periodic interrupt control register pitr sim periodic interrupt timer register portc sim port c data register porte sim port e data register portf sim port f data register portqa qadc port a data register portqb qadc port b data register portqs qsm port qs data register pqspar qsm port qs pin assignment register presdiv toucan prescaler divide register pwm[5:8]c ctm4 pwmsm counter registers [5:8] pwm[5:8]a ctm4 pwmsm period registers [5:8] pwm[5:8]b ctm4 pwmsm pulse width registers [5:8] pwm[5:8]sic ctm4 pwmsm status/interrupt/control registers [5:8] qacr[0:1] qadc control registers [0:2] qadcint qadc interrupt register qadcmcr qadc module configuration register qadctest qadc test register qasr qadc status register qilr qsm interrupt level register qivr qsm interrupt vector register qsmcr qsm module configuration register qtest qsm test register rambah ram base address high register 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola nomenclature MC68336/376 2-6 user? manual rambal ram base address low register rammcr ram module configuration register ramtst ram test register rombah rom base address high register rombal rom base address low register rr[0:f] qsm receive ram rsighi rom signature high register rsiglo rom signature low register rombs[0:3] rom bootstrap words [0:3] rxgmskhi toucan receive global mask high register rxgmsklo toucan receive global mask low register rx[14:15]mskhi toucan receive buffer [14:15] mask high registers rx[14:15]msklo toucan receive buffer [14:15] mask low registers rjurr[0:27] qadc right-justified unsigned result registers rsr sim reset status register rxectr toucan receive error counter register sccr[0:1] qsm sci control registers [0:1] scdr qsm sci data register scsr qsm sci status register sglr service grant latch register simcr sim module configuration register simtr sim system integration test register simtre sim system integration test register (eclk) spcr[0:3] qsm qspi control registers [0:3] spsr qsm qspi status register swsr sim software watchdog service register syncr sim clock synthesizer control register sypcr sim system protection control register ticr tpu interrupt configuration register timer toucan free running timer register tpumcr tpu module configuration register tr[0:f] qsm transmit ram trambar tpuram base address register trammcr tpuram module configuration register tramtst tpuram test register tstmsra sim test module master shift register a tstmsrb sim test module master shift register b 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 nomenclature motorola user? manual 2-7 tstrc sim test module repetition counter register tstsc sim test module shift count register ttr toucan test register txectr toucan transmit error counter register 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola nomenclature MC68336/376 2-8 user? manual 2.5 conventions logic level one is the voltage that corresponds to a boolean true (1) state. logic level zero is the voltage that corresponds to a boolean false (0) state. set refers specifically to establishing logic level one on a bit or bits. clear refers specifically to establishing logic level zero on a bit or bits. asserted means that a signal is in active logic state. an active low signal changes from logic level one to logic level zero when asserted. an active high signal changes from logic level zero to logic level one. negated means that an asserted signal changes logic state. an active low signal changes from logic level zero to logic level one when negated. an active high signal changes from logic level one to logic level zero. a specific mnemonic within a range is referred to by mnemonic and number. a15 is bit 15 of accumulator a; addr7 is line 7 of the address bus; csor0 is chip-select op- tion register 0. a range of mnemonics is referred to by mnemonic and the numbers that define the range. vbr[4:0] are bits four to zero of the vector base register; csor[0:5] are the first six option registers. parentheses are used to indicate the content of a register or memory location rather than the register or memory location itself. (a) is the content of accumulator a. (m : m + 1) is the content of the word at address m. lsb means least significant bit. msb means most significant bit. references to low and high bytes are spelled out. lsw means least significant word. msw means most significant word. addr is the address bus. addr[7:0] are the eight lsbs of the address bus. data is the data bus. data[15:8] are the eight msbs of the data bus. 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 overview motorola user? manual 3-1 section 3 overview this section contains information about the entire MC68336/376 modular microcon- troller. it lists the features of each module, shows device functional divisions and pin assignments, summarizes signal and pin functions, discusses the intermodule bus, and provides system memory maps. timing and electrical specifications for the entire microcontroller and for individual modules are provided in appendix a electri- cal characteristics . comprehensive module register descriptions and memo- ry maps are provided in appendix d register summary . 3.1 mcu features the following paragraphs highlight capabilities of each of the microcontroller modules. each module is discussed separately in a subsequent section of this user's manual. 3.1.1 central processing unit (cpu32) ?32-bit architecture ?virtual memory implementation ?table look-up and interpolate instruction ?improved exception handling for controller applications ?high level language support ?background debug mode ?fully static operation 3.1.2 system integration module (sim) ?external bus support ?programmable chip select outputs ?system protection logic ?watchdog timer, clock monitor and bus monitor ?two 8-bit dual function input/output ports ?one 7-bit dual function output port ?phase-locked loop (pll) clock system 3.1.3 standby ram module (sram) ?4-kbytes of static ram ?no standby supply 3.1.4 masked rom module (mrm) ?8-kbyte array, accessible as bytes or words ?user selectable default base address ?user selectable bootstrap rom function ?user selectable rom verification code 336376umsect3overview page 1 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-2 user? manual 3.1.5 10-bit queued analog-to-digital converter (qadc) ?16 channels internally; up to 44 directly accessible channels with external multi- plexing ?six automatic channel selection and conversion modes ?two channel scan queues of variable length, each with a variable number of sub- queues ?40 result registers and three result alignment formats ?programmable input sample time ?direct control of external multiplexers 3.1.6 queued serial module (qsm) ?enhanced serial communications interface (sci) ?modulus baud rate generator ?parity detection ?queued serial peripheral interface (qspi) ?80-byte static ram to perform queued operations ?up to 16 automatic transfers ?continuous cycling, 8 to 16 bits per transfer, lsb or msb first ?dual function i/o pins 3.1.7 configurable timer module version 4 (ctm4) ?two 16-bit modulus counter submodules (mcsms) ?16-bit free-running counter submodule (fcsm) ?four double-action submodules (dasms) ?four pulse-width submodules (pwmsms) 3.1.8 time processor unit (tpu) ?dedicated micro-engine operating independently of the cpu32 ?16 independent programmable channels and pins ?each channel has an event register consisting of a 16-bit capture register, a 16- bit compare register and a 16-bit comparator ?any channel can perform any time function ?each channel has six or eight 16-bit parameter registers ?each timer function may be assigned to more than one channel ?two timer counter registers with programmable prescalers ?each channel can be synchronized to one or both counters ?selectable channel priority levels 3.1.9 static ram module with tpu emulation capability (tpuram) ?3.5 kbytes of static ram ?external vstby pin for separate standby supply ?may be used as normal ram or tpu microcode emulation ram 336376umsect3overview page 2 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-3 3.1.10 can 2.0b controller module (toucan) ?full implementation of can protocol specification, version 2.0 a and b ?16 receive/transmit message buffers of 0 to 8 bytes data length ?global mask register for message buffers 0 to 13 ?independent mask registers for message buffers 14 and 15 ?programmable transmit-first scheme: lowest id or lowest buffer number ?16-bit free-running timer for message time-stamping ?low power sleep mode with programmable wake-up on bus activity 3.2 intermodule bus the intermodule bus (imb) is a standardized bus developed to facilitate both design and operation of modular microcontrollers. it contains circuitry to support exception processing, address space partitioning, multiple interrupt levels, and vectored inter- rupts. the standardized modules in the mcu communicate with one another through the imb. the imb in the mcu uses 24 address and 16 data lines. 3.3 system block diagram and pin assignment diagrams figure 3-1 is a functional diagram of the mcu. there is not a one-to-one correspon- dence between location and size of blocks in the diagram and location and size of in- tegrated-circuit modules. figure 3-2 shows the MC68336 pin assignment package; figure 3-3 shows the mc68376 pin assignment package. note that the mc68376 is a pin-compatible upgrade for the MC68336 that provides a can protocol controller and an 8-kbyte masked rom module. both devices use a 160-pin plastic surface- mount package. refer to b.1 obtaining updated MC68336/376 mechanical infor- mation for package dimensions. refer to subsequent paragraphs in this section for pin and signal descriptions. 336376umsect3overview page 3 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-4 user? manual figure 3-1 MC68336/376 block diagram txd/pqs7 pcs3/pqs6 pcs2/pqs5 pcs1/pqs4 pcs0/ss /pqs3 sck/pqs2 mosi/pqs1 miso/pqs0 cs[10:0] qsm port qs ctm4 1 fcsm 2 mcsms dasms pwmsms 4 4 3.5 kbyte tpu cpu32 chip selects ebi clock test control port c rxd bgack br bg fc0 fc1 fc2 addr addr21/cs8 /pc5 addr22/cs9 /pc6 addr23/cs10 /eclk addr20/cs7 /pc4 addr19/cs6 /pc3 fc2/cs5 /pc2 fc1/cs4 /pc1 fc0/cs3 /pc0 dsack0 dsack1 avec rmc ds as siz0 siz1 siz1/pe7 siz0/pe6 as /pe5 ds /pe4 rmc /pe3 avec /pe2 dsack1 /pe1 dsack0 /pe0 addr[18:0] data[15:0] irq[7:1] r/w reset halt berr modclk/pf0 irq7 /pf7 irq6 /pf6 irq5 /pf5 irq4 /pf4 irq3 /pf3 irq2 /pf2 irq1 /pf1 modclk clkout xtal extal xfc vddsyn tstme quot freeze bkpt ifetch ipipe dsi dso dsclk freeze/quot tstme /tsc bkpt/ dsclk ifetch/ dsi ipipe/ dso control control control control port e port f bgack /cs2 bg /cs1 br /cs0 imb cpwm[8:5] ctd[10:9]/ctd[4:3] vstby t2clk tpuch[15:0] csboot vdd vss ctm2c 336/376 block [23:19] 1. port a pins incorporate open drain pull down drivers 4k sram qadc port qb port qa vrh vrl pqb[7:0] pqa[7:0] 1 vssa vdda canrx0 cantx0 tsc tpuram t ou can mc68376 only 8k mrm mc68376 only 336376umsect3overview page 4 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-5 figure 3-2 MC68336 pin assignments for 160-pin package 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 *nc ctm2c ctd3 ctd4 cpwm5 cpwm6 cpwm7 cpwm8 ctd9 ctd10 tpuch0 vss tpuch1 tpuch2 vdd tpuch3 tpuch4 tpuch5 tpuch6 vss vdd tpuch7 tpuch8 tpuch9 tpuch10 vstby vss tpuch11 tpuch12 vdd tpuch13 tpuch14 tpuch15 t2clk pc6/addr22/cs9 pc5/addr21/cs8 pc4/addr20/cs7 pc3/addr19/cs6 vss vdd pc2/fc2/cs5 pc1/fc1/cs4 fc0/cs3 bga ck /cs2 bg /cs1 br /cs0 csboo t data0 data1 data2 vss data3 data4 vdd data5 data6 data7 data8 vss data9 data10 data11 data12 data13 vss data14 data15 vdd addr0 pe0/dsa ck0 pe1/dsa ck1 pe2/a vec pe3/rmc pe4/ds pe5/as pe6/siz0 pe7/siz1 r/w vss addr23/cs10 /eclk *nc rxd txd/pqs7 pcs3/pqs6 pcs2/pqs5 pcs1/pqs4 pcs0/ss /pqs3 sck/pqs2 mosi/pqs1 miso/pqs0 addr1 vdd addr2 addr3 vss addr4 addr5 addr6 addr7 vss addr8 addr9 addr10 addr11 addr12 addr13 addr14 addr15 addr16 vdd addr17 addr18 vss an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 vrh vrl vssa vdda an52/ma0/pqa0 an53/ma1/pqa1 an54/ma2/pqa2 an55/etrig1/pqa3 an56/etrig2/pqa4 an57/pqa5 an57/pqa6 an59/pqa7 vss xtal vddsyn extal vss vdd xfc vdd vss clkout ipipe /dso ifetch /dsi freeze/quot bkpt /dsclk tstme /tsc reset hal t berr pf7/irq7 pf6/irq6 pf5/irq5 pf4/irq4 pf3/irq3 pf2/irq2 pf1/irq1 pf0/modclk vdd 336 160-pin qfp MC68336 *note: MC68336 revision d and later (f60k and later mask sets) have assigned pins 1 and 160 as ?o connect? to allow pin compatibility with the mc68376. for revision c (d65j mask set) devices, pin 1 is v ss and pin 160 is v dd . 336376umsect3overview page 5 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-6 user? manual figure 3-3 mc68376 pin assignments for 160-pin package 3.4 pin descriptions the following tables summarize the functional characteristics of MC68336/376 pins. table 3-1 shows all inputs and outputs. digital inputs and outputs use cmos logic lev- els. an entry in the ?iscrete i/o?column indicates that a pin can also be used for gen- eral-purpose input, output, or both. the i/o port designation is given when it applies. refer to figure 3-1 for port organization. table 3-2 shows types of output drivers. ta- ble 3-3 shows the characteristics of power pins. 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 canrx0 ctm2c ctd3 ctd4 cpwm5 cpwm6 cpwm7 cpwm8 ctd9 ctd10 tpuch0 vss tpuch1 tpuch2 vdd tpuch3 tpuch4 tpuch5 tpuch6 vss vdd tpuch7 tpuch8 tpuch9 tpuch10 vstby vss tpuch11 tpuch12 vdd tpuch13 tpuch14 tpuch15 t2clk pc6/addr22/cs9 pc5/addr21/cs8 pc4/addr20/cs7 pc3/addr19/cs6 vss vdd pc2/fc2/cs5 pc1/fc1/cs4 fc0/cs3 bga ck /cs2 bg /cs1 br /cs0 csboo t data0 data1 data2 vss data3 data4 vdd data5 data6 data7 data8 vss data9 data10 data11 data12 data13 vss data14 data15 vdd addr0 pe0/dsa ck0 pe1/dsa ck1 pe2/a vec pe3/rmc pe4/ds pe5/as pe6/siz0 pe7/siz1 r/w vss addr23/cs10 /eclk cantx0 rxd txd/pqs7 pcs3/pqs6 pcs2/pqs5 pcs1/pqs4 pcs0/ss /pqs3 sck/pqs2 mosi/pqs1 miso/pqs0 addr1 vdd addr2 addr3 vss addr4 addr5 addr6 addr7 vss addr8 addr9 addr10 addr11 addr12 addr13 addr14 addr15 addr16 vdd addr17 addr18 vss an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 vrh vrl vssa vdda an52/ma0/pqa0 an53/ma1/pqa1 an54/ma2/pqa2 an55/etrig1/pqa3 an56/etrig2/pqa4 an57/pqa5 an57/pqa6 an59/pqa7 vss xtal vddsyn extal vss vdd xfc vdd vss clkout ipipe /dso ifetch /dsi freeze/quot bkpt /dsclk tstme /tsc reset hal t berr pf7/irq7 pf6/irq6 pf5/irq5 pf4/irq4 pf3/irq3 pf2/irq2 pf1/irq1 pf0/modclk vdd 376 160-pin qfp mc68376 336376umsect3overview page 6 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-7 table 3-1 MC68336/376 pin characteristics pin mnemonic output driver input synchronized input hysteresis discrete i/o port designation addr23/cs10/ eclk a yes no o addr[22:19]/cs[9:6] a yes no o pc[6:3] addr[18:0] a yes no an[51:48] yes 1 yes i pqb[7:4] an[3:0]/an[w, x, y, z] yes 1 yes i pqb[3:0] an[59:57] ba yes yes i/o pqa[7:5] an[56:55]/etrig[2:1] ba yes yes i/o pqa[4:3] an[54:52]/ma[2:0] ba yes yes i/o pqa[2:0] as b yes yes i/o pe5 avec b yes no i/o pe2 berr b yes no bg /cs1 b bgack /cs2 b yes no bkpt /dsclk yes yes br /cs0 b yes no o clkout a canrx0 (mc68376 only) yes yes cantx0 (mc68376 only) bo csboot b ctd[10:9]/[4:3] a yes yes i/o cpwm[8:5] a o ctm2c yes yes i data[15:0] aw yes 1 no ds b yes yes i/o pe4 dsack[1:0] b yes no i/o pe[1:0] extal 2 special fc[2:0]/cs[5:3] a yes no o pc[2:0] freeze/quot a ipipe /dso a o ifetch /dsi a yes yes halt bo yes no irq[7:1] b yes yes i/o pf[7:1] miso bo yes 1 yes i/o pqs0 modclk b yes 1 yes i/o pf0 mosi bo yes 1 yes i/o pqs1 pcs0/ss bo yes 1 yes i/o pqs3 pcs[3:1] bo yes 1 yes i/o pqs[6:4] r/w a yes no reset bo yes yes rmc b yes yes i/o pe3 rxd no yes sck bo yes 1 yes i/o pqs2 336376umsect3overview page 7 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-8 user? manual notes: 1. data[15:0] are synchronized during reset only. modclk, and the qsm and qadc pins are synchronized only when used as input port pins. 2. extal, xfc and xtal are clock reference connections. siz[1:0] b yes yes i/o pe[7:6] t2clk yes yes tpuch[15:0] a yes yes tstme /tsc yes yes txd bo yes 1 yes i/o pqs7 xfc 2 special xtal 2 special table 3-2 MC68336/376 output driver types type description a output only signals that are always driven. no external pull-up required. ao type a output that can be operated in an open-drain mode. aw type a output with p-channel precharge when reset. b three-state output that includes circuitry to assert output before high impedance is established, to ensure rapid rise time. an external holding resistor is required to maintain logic level while in the high-impedance state. bo type b output that can be operated in an open-drain mode. ba three-state output that can be operated in open-drain mode only. table 3-3 MC68336/376 power connections pin description v stby standby ram power v ddsyn clock synthesizer power v dda, v ssa qadc converter power v rh, v rl qadc reference voltage v ss, v dd microcontroller power table 3-1 MC68336/376 pin characteristics (continued) pin mnemonic output driver input synchronized input hysteresis discrete i/o port designation 336376umsect3overview page 8 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-9 3.5 signal descriptions the following tables define the MC68336/376 signals. table 3-4 shows signal origin, type, and active state. table 3-5 describes signal functions. both tables are sorted al- phabetically by mnemonic. mcu pins often have multiple functions. more than one de- scription can apply to a pin. table 3-4 MC68336/376 signal characteristics signal name mcu module signal type active state addr[23:0] sim bus an[59:48]/[3:0] qadc input an[w, x, y, z] qadc input as sim output 0 avec sim input 0 berr sim input 0 bg sim output 0 bgack sim input 0 bkpt cpu32 input 0 br sim input 0 clkout sim output canrx0 (mc68376 only) toucan input cantx0 (mc68376 only) toucan output cs[10:0] sim output 0 csboot sim output 0 cpwm[8:5] ctm4 output ctd[10:9]/[4:3] ctm4 input/output ctm2c ctm4 input data[15:0] sim bus ds sim output 0 dsack[1:0] sim input 0 dsclk cpu32 input serial clock dsi cpu32 input serial data dso cpu32 output serial data eclk sim output etrig[2:1] qadc input extal sim input fc[2:0] sim output freeze sim output 1 halt sim input/output 0 ifetch cpu32 output 0 ipipe cpu32 output 0 irq[7:1] sim input 0 ma[2:0] qadc output 1 miso qsm input/output modclk sim input mosi qsm input/output pc[6:0] sim output pcs[3:0] qsm input/output pe[7:0] sim input/output pf[7:0] sim input/output 336376umsect3overview page 9 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-10 user? manual pqa[7:0] qadc input/output pqb[7:0] qadc input pqs[7:0] qsm input/output quot sim output r/w sim output 1/0 reset sim input/output 0 rmc sim output 0 rxd qsm input sck qsm input/output siz[1:0] sim output 1 ss qsm input 0 t2clk tpu input tpuch[15:0] tpu input/output tstme /tsc sim input 0/1 txd qsm output xfc sim input xtal sim output table 3-4 MC68336/376 signal characteristics (continued) signal name mcu module signal type active state 336376umsect3overview page 10 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-11 table 3-5 MC68336/376 signal functions mnemonic signal name function addr[23:0] address bus 24-bit address bus used by the cpu32 an[59:48]/[3:0] qadc analog input 16 channel a/d converter analog input pins an[w, x, y, z] qadc analog input four input channels utilized when operating in multiplexed mode as address strobe indicates that a valid address is on the address bus avec autovector requests an automatic vector during interrupt acknowledge berr bus error indicates that a bus error has occurred bg bus grant indicates that the mcu has relinquished the bus bgack bus grant acknowledge indicates that an external device has assumed bus mastership bkpt breakpoint signals a hardware breakpoint to the cpu br bus request indicates that an external device requires bus mastership clkout system clock out system clock output canrx0 toucan receive data can serial data input cantx0 toucan transmit data can serial data output cs[10:0] chip-selects select external devices at programmed addresses csboot boot chip-select chip-select for external bootstrap memory cpwm[8:5] ctm4 pwms four pulse-width modulation channels ctd[10:9]/[4:3] ctm4 double action channels bidirectional double action timer channels ctm2c ctm4 modulus clock modulus counter clock input data[15:0] data bus 16-bit data bus used by the cpu32 ds data strobe indicates that an external device should place valid data on the data bus during a read cycle and that valid data has been placed on the data bus by the cpu during a write cycle. dsack[1:0] data and size acknowledge provides asynchronous data transfers and dynamic bus sizing dsi, dso, dsclk developmental serial in, out, clock serial i/o and clock for background debug mode eclk e-clock m6800 bus clock output etrig[2:1] qadc external trigger external trigger pins used when a qadc scan queue is in external trigger mode extal, xtal crystal oscillator connections for clock synthesizer circuit reference; a crystal or an external oscillator can be used fc[2:0] function codes identify processor state and current address space freeze freeze indicates that the cpu has acknowledged a breakpoint halt halt suspend external bus activity ifetch instruction pipeline indicates instruction pipeline activity ipipe instruction pipeline indicates instruction pipeline activity irq[7:1] interrupt request requests an interrupt of specified priority level from the cpu ma[2:0] qadc multiplexed address when external multiplexing is used, these pins provide addresses to the external multiplexer miso master in, slave out serial input to qspi in the master mode; serial output from qspi in the slave mode modclk clock mode select selects the source of the system clock mosi master out, slave in serial output from the qspi in master mode; serial input to the qspi in slave mode pc[6:0] port c sim digital output port signals pcs[3:0] peripheral chip-selects qspi peripheral chip-select pe[7:0] port e sim digital input/output port signals pf[7:0] port f sim digital input/output port signals 336376umsect3overview page 11 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-12 user? manual pqa[7:0] qadc port a qadc port a digital input/output port signals pqb[7:0] qadc port b qadc port b digital input port signals pqs[7:0] port qs qsm digital input/output port signals quot quotient out provides the quotient bit of the polynomial divider (test mode only) r/w read/write indicates the direction of data transfer on the bus reset reset system reset rmc read-modify-write cycle indicates an indivisible read-modify-write instruction rxd sci receive data serial input to the sci sck qspi serial clock clock output from qspi in master mode; clock input to qspi in slave mode siz[1:0] size indicates the number of bytes remaining to be transferred during a bus cycle ss slave select starts serial transmission when qspi is in slave mode; chip-select in master mode t2clk tpu clock tpu clock input tpuch[15:0] tpu i/o channels bidirectional tpu channels tsc three-state control places all output drivers in a high impedance state tstme test mode enable hardware enable for sim test mode txd sci transmit data serial output from the sci xfc external filter capacitor connection for external phase-locked loop filter capacitor table 3-5 MC68336/376 signal functions (continued) mnemonic signal name function 336376umsect3overview page 12 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-13 3.6 internal register map in figure 3-4 , imb addr[23:20] are represented by the letter y. the value represent- ed by y determines the base address of mcu module control registers. in the MC68336/376, y is equal to m111, where m is the logic state of the module mapping (mm) bit in the system integration module configuration register (simcr). figure 3-4 MC68336/376 address map ctm4 256 bytes sim 128 bytes tpuram control 64 bytes sram control 8 bytes qsm 512 bytes tpu 512 bytes tpuram array 3.5 kbytes sram array 4.0 kbytes $yff000 $yff080 $yff400 $yff500 $yffa00 $yffa80 $yffb00 $yffb40 $yffb48 $yffc00 $yffe00 $yfffff 336/376 address map notes: 1. y=m111, where m is the modmap signal state on the imb, which reflects the state of the modmap in the module configuration register of the system integration module. (y=$7 or $f) 2. attempted accesses to unused locations or unused bits within valid locations return all zeros. $yff200 $yff820 $yff83f 8k rom control 32 bytes (mc68376) qadc 512 bytes rom array 8 kbytes (mc68376) unused unused unused unused unused t ou can 384 bytes (mc68376) 336376umsect3overview page 13 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-14 user? manual 3.7 address space maps figure 3-5 shows a single memory space. function codes fc[2:0] are not decoded externally so that separate user/supervisor or program/data spaces are not provided. in figure 3-6 , fc2 is decoded, resulting in separate supervisor and user spaces. fc[1:0] are not decoded, so that separate program and data spaces are not provided. in figures 3-7 and 3-8 , fc[2:0] are decoded, resulting in four separate memory spac- es: supervisor/program, supervisor/data, user/program and user/data. all exception vectors are located in supervisor data space, except the reset vector, which is located in supervisor program space. only the initial reset vector is fixed in the processor? memory map. once initialization is complete, there are no fixed as- signments. since the vector base register (vbr) provides the base address of the vec- tor table, the vector table can be located anywhere in memory. refer to section 4 central processor unit for more information concerning memory manage- ment, extended addressing, and exception processing. refer to 5.5.1.7 function codes for more information concerning function codes and address space types. 336376umsect3overview page 14 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-15 figure 3-5 overall memory map 336//376 s/u comb map $000000 $ffffff $fff000 combined supervisor and user space $7ff000 notes: reset ?initial stack pointer reset ?initial pc bus error address error illegal instruction zero division chk, chk2 instructions trapcc, trapv instructions privilege violation trace line 1010 emulator line 1111 emulator hardware breakpoint (reserved coprocessor protocol violation) format error and uninitialized interrupt format error and uninitialized interrupt (unassigned, reserved) spurious interrupt level 1 interrupt autovector level 2 interrupt autovector level 3 interrupt autovector level 4 interrupt autovector level 5 interrupt autovector level 6 interrupt autovector level 7 interrupt autovector tap instruction vectors (0?5) (reserved, coprocessor) (unassigned, reserved) user-defined vectors 0000 0004 0008 000c 0010 0014 0018 001c 0020 0024 0028 002c 0030 0034 0038 003c 0040?05c 006c 0064 0068 006c 0070 0074 0078 007c 0080?0bc 00c0?0eb 00ec?0fc 0100?3fc vector offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16?3 24 25 26 27 28 29 30 31 32?7 48?8 59?3 64?55 vector number type of exception $yff000 $yff080 $yff400 $yffb40 $yff500 $yff83f $yffb48 $yfffff $yffb00 $yff200 $yff820 $yffa00 $yffa80 $yffc00 $yffe00 toucan (mc68376) qadc ctm4 mrm control (mc68376) sim tpuram ctl sram ctl qsm tpu $xx0000 $xx03fc internal registers (mm = 0) internal registers (mm = 1) 1. location of the exception vector table is determined by the vector base register. the vector address is the concatenation of the upper 22 bits of the vbr with the 8-bit vector number of the interrupting module. the result is left justified to force long word alignment. 2. location of the module control registers is determined by the state of the module mapping (mm) bit in the sim configuration register. y = m111 where m is the state of the mm bit. 3. some unused addresses within the internal register block are mapped externally. refer to the appropriate module reference manual for information on mapping of unused addresses within internal register blocks. 336376umsect3overview page 15 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-16 user? manual figure 3-6 separate supervisor and user space map 336/376 s/u sep map reset ?initial stack pointer reset ?initial pc bus error address error illegal instruction zero division chk, chk2 instructions trapcc, trapv instructions privilege violation trace line 1010 emulator line 1111 emulator hardware breakpoint (reserved coprocessor protocol violation) format error and uninitialized interrupt format error and uninitialized interrupt (unassigned, reserved) spurious interrupt level 1 interrupt autovector level 2 interrupt autovector level 3 interrupt autovector level 4 interrupt autovector level 5 interrupt autovector level 6 interrupt autovector level 7 interrupt autovector tap instruction vectors (0?5) (reserved, coprocessor) (unassigned, reserved) user-defined vectors 0000 0004 0008 000c 0010 0014 0018 001c 0020 0024 0028 002c 0030 0034 0038 003c 0040?05c 006c 0064 0068 006c 0070 0074 0078 007c 0080?0bc 00c0?0eb 00ec?0fc 0100?3fc vector offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16?3 24 25 26 27 28 29 30 31 32?7 48?8 59?3 64?55 vector number type of exception user space $000000 $ffffff $fff000 supervisor space $7ff000 $000000 $ffffff $fff000 4 $7ff000 4 $yff000 $yff080 $yff400 $yffb40 $yff500 $yff83f $yffb48 $yfffff $yffb00 $yff200 $yff820 $yffa00 $yffa80 $yffc00 $yffe00 toucan (mc68376) qadc ctm4 mrm control (mc68376) sim tpuram ctl sram ctl qsm tpu internal registers internal registers $xx0000 $xx03fc internal registers internal registers notes: 1. location of the exception vector table is determined by the vector base register. the vector address is the concatenation of the upper 22 bits of the vbr with the 8-bit vector number of the interrupting module. the result is left justified to force long word alignment. 2. location of the module control registers is determined by the state of the module mapping (mm) bit in the sim configuration register. y = m111 where m is the state of the mm bit. 3. some unused addresses within the internal register block are mapped externally. refer to the appropriate module reference manual for information on mapping of unused addresses within internal register blocks. 4. some internal registers are not available in user space. 336376umsect3overview page 16 thursday, december 5, 1996 4:45 pm
MC68336/376 overview motorola user? manual 3-17 figure 3-7 supervisor space (separate program/data space) map 336/376 super p/d map $000000 bus error address error illegal instruction zero division chk, chk2 instructions trapcc, trapv instructions privilege violation trace line 1010 emulator line 1111 emulator hardware breakpoint (reserved coprocessor protocol violation) format error and uninitialized interrupt format error and uninitialized interrupt (unassigned, reserved) spurious interrupt level 1 interrupt autovector level 2 interrupt autovector level 3 interrupt autovector level 4 interrupt autovector level 5 interrupt autovector level 6 interrupt autovector level 7 interrupt autovector tap instruction vectors (0?5) (reserved, coprocessor) (unassigned, reserved) user-defined vectors 0008 000c 0010 0014 0018 001c 0020 0024 0028 002c 0030 0034 0038 003c 0040?05c 006c 0064 0068 006c 0070 0074 0078 007c 0080?0bc 00c0?0eb 00ec?0fc 0100?3fc vector offset 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16?3 24 25 26 27 28 29 30 31 32?7 48?8 59?3 64?55 vector number exception vectors located in supervisor data space supervisor program space $000000 $ffffff $fff000 supervisor data space $7ff000 $ffffff reset ?initial stack pointer reset ?initial pc 0000 0004 vector offset 0 1 vector number exception vectors located in supervisor program space $yff000 $yff080 $yff400 $yffb40 $yff500 $yff83f $yffb48 $yfffff $yffb00 $yff200 $yff820 $yffa00 $yffa80 $yffc00 $yffe00 toucan (mc68376) qadc ctm4 mrm control (mc68376) sim tpuram ctl sram ctl qsm tpu $xx03fc $xx0008 $xx0000 $xx0004 internal registers internal registers notes: 1. location of the exception vector table is determined by the vector base register. the vector address is the concatenation of the upper 22 bits of the vbr with the 8-bit vector number of the interrupting module. the result is left justified to force long word alignment. 2. location of the module control registers is determined by the state of the module mapping (mm) bit in the sim configuration register. y = m111 where m is the state of the mm bit. 3. some unused addresses within the internal register block are mapped externally. refer to the appropriate module reference manual for information on mapping of unused addresses within internal register blocks. 4. some internal registers are not available in user space. 336376umsect3overview page 17 thursday, december 5, 1996 4:45 pm
motorola overview MC68336/376 3-18 user? manual figure 3-8 user space (separate program/data space) map 336/376 user p/d map user program space $000000 $ffffff $000000 $ffffff $fff000 user data space $7ff000 $yff000 $yff080 $yff400 $yffb40 $yff500 $yff83f $yffb48 $yfffff $yffb00 $yff200 $yff820 $yffa00 $yffa80 $yffc00 $yffe00 toucan (mc68376) qadc ctm4 mrm control (mc68376) sim tpuram ctl sram ctl qsm tpu internal registers internal registers notes: 1. location of the module control registers is determined by the state of the module mapping (mm) bit in the sim configuration register. y = m111, where m is the state of the mm bit. 2. unused addresses within the internal register block are mapped externally. ?eserved?blocks are not mapped externally. 3. some internal registers are not available in user space. 336376umsect3overview page 18 thursday, december 5, 1996 4:45 pm
MC68336/376 central processor unit motorola user? manual 4-1 section 4 central processor unit the cpu32, the instruction processing module of the m68300 family, is based on the industry-standard mc68000 processor. it has many features of the mc68010 and mc68020, as well as unique features suited for high-performance controller applica- tions. this section is an overview of the cpu32. for detailed information concerning cpu operation, refer to the cpu32 reference manual (cpu32rm/ad). 4.1 general ease of programming is an important consideration in using a microcontroller. the cpu32 instruction format reflects a philosophy emphasizing register-memory interac- tion. there are eight multifunction data registers and seven general-purpose address- ing registers. all data resources are available to all operations requiring those resources. the data registers readily support 8-bit (byte), 16-bit (word), and 32-bit (long-word) operand lengths for all operations. word and long-word operations support address manipula- tion. although the program counter (pc) and stack pointers (sp) are special-purpose registers, they are also available for most data addressing activities. ease of program checking and diagnosis is further enhanced by trace and trap capabilities at the in- struction level. a block diagram of the cpu32 is shown in figure 4-1 . the major blocks operate in a highly independent fashion that maximizes concurrency of operation while managing the essential synchronization of instruction execution and bus operation. the bus con- troller loads instructions from the data bus into the decode unit. the sequencer and control unit provide overall chip control, managing the internal buses, registers, and functions of the execution unit. 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-2 user? manual figure 4-1 cpu32 block diagram 4.2 cpu32 registers the cpu32 programming model consists of two groups of registers that correspond to the user and supervisor privilege levels. user programs can use only the registers of the user model. the supervisor programming model, which supplements the user programming model, is used by cpu32 system programmers who wish to protect sen- sitive operating system functions. the supervisor model is identical to that of the mc68010 and later processors. the cpu32 has eight 32-bit data registers, seven 32-bit address registers, a 32-bit program counter, separate 32-bit supervisor and user stack pointers, a 16-bit status register, two alternate function code registers, and a 32-bit vector base register. refer to figures 4-2 and 4-3 . instruction pipeline stage stage cb execution unit program counter section data section write pending buffer prefetch controller microbus controller address bus data bus bus control signals stage a microsequencer and control buffer decode control store control logic 1127a 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-3 figure 4-2 user programming model 16 31 15 0 87 d0 d2 d4 d6 d7 data registers address registers cpu32 user prog model 16 31 15 0 d1 d3 d5 a0 a1 a2 a3 a4 a5 a6 16 31 15 0 a7 (ssp) user stack pointer 31 0 pc program counter ccr condition code register 0 7 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-4 user? manual figure 4-3 supervisor programming model supplement 4.2.1 data registers the eight data registers can store data operands of 1, 8, 16, 32, and 64 bits and ad- dresses of 16 or 32 bits. the following data types are supported: ?bits ?packed binary-coded decimal digits ?byte integers (8 bits) ?word integers (16 bits) ?long-word integers (32 bits) ?quad-word integers (64 bits) each of data registers d7?0 is 32 bits wide. byte operands occupy the low-order 8 bits; word operands, the low-order 16 bits; and long-word operands, the entire 32 bits. when a data register is used as either a source or destination operand, only the ap- propriate low-order byte or word (in byte or word operations, respectively) is used or changed; the remaining high-order portion is unaffected. the least significant bit (lsb) of a long-word integer is addressed as bit zero, and the most significant bit (msb) is addressed as bit 31. figure 4-4 shows the organization of various types of data in the data registers. quad-word data consists of two long words and represents the product of 32-bit mul- tiply or the dividend of 32-bit divide operations (signed and unsigned). quad-words may be organized in any two data registers without restrictions on order or pairing. there are no explicit instructions for the management of this data type, although the movem instruction can be used to move a quad-word into or out of the registers. binary-coded decimal (bcd) data represents decimal numbers in binary form. cpu32 bcd instructions use a format in which a byte contains two digits. the four lsb con- tain the least significant digit, and the four msb contain the most significant digit. the abcd, sbcd, and nbcd instructions operate on two bcd digits packed into a single byte. 16 31 15 0 15 0 87 (ccr) 31 0 0 2 a7?(ssp) sr vbr sfc dfc supervisor stack pointer status register vector base register alternate function code registers cpu32 supv prog model 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-5 figure 4-4 data organization in data registers 4.2.2 address registers each address register and stack pointer is 32 bits wide and holds a 32-bit address. ad- dress registers cannot be used for byte-sized operands. therefore, when an address register is used as a source operand, either the low-order word or the entire long-word operand is used, depending upon the operation size. when an address register is used as the destination operand, the entire register is affected, regardless of the op- eration size. if the source operand is a word size, it is sign-extended to 32 bits. ad- dress registers are used primarily for addresses and to support address computation. the instruction set includes instructions that add to, subtract from, compare, and move the contents of address registers. figure 4-5 shows the organization of addresses in address registers. 30 31 high-order byte cpu32 data org middle high byte middle low byte low-order byte msb 0 1 lsb 24 31 23 16 15 8 7 0 byte word 31 16 15 0 high-order word low-order word long word 31 0 long word quad-word msb 62 63 32 high-order long word 31 0 lsb 1 low-order long word 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-6 user? manual figure 4-5 address organization in address registers 4.2.3 program counter the pc contains the address of the next instruction to be executed by the cpu32. during instruction execution and exception processing, the processor automatically increments the contents of the pc or places a new value in the pc as appropriate. 4.2.4 control registers the control registers described in this section contain control information for supervi- sor functions and vary in size. with the exception of the condition code register (the user portion of the status register), they are accessed only by instructions at the su- pervisor privilege level. 4.2.4.1 status register the status register (sr) stores the processor status. it contains the condition codes that reflect the results of a previous operation and can be used for conditional instruc- tion execution in a program. the condition codes are extend (x), negative (n), zero (z), overflow (v), and carry (c). the user (low-order) byte containing the condition codes is the only portion of the sr information available at the user privilege level; it is referenced as the condition code register (ccr) in user programs. at the supervisor privilege level, software can access the full status register. the upper byte of this register includes the interrupt priority (ip) mask (three bits), two bits for placing the processor in one of two tracing modes or disabling tracing, and the super- visor/user bit for placing the processor at the desired privilege level. undefined bits in the status register are reserved by motorola for future definition. the undefined bits are read as zeros and should be written as zeros for future compatibility. all operations to the sr and ccr are word-size operations, but for all ccr operations, the upper byte is read as all zeros and is ignored when written, regardless of privilege level. refer to d.1.2 status register for bit/field definitions and a diagram of the status reg- ister. cpu32 addr org 31 16 15 0 sign extended 16-bit address operand 31 0 full 32-bit address operand 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-7 4.2.4.2 alternate function code registers alternate function code registers (sfc and dfc) contain 3-bit function codes. func- tion codes can be considered extensions of the 24-bit linear address that optionally provide as many as eight 16-mbyte address spaces. the processor automatically gen- erates function codes to select address spaces for data and programs at the user and supervisor privilege levels and to select a cpu address space used for processor functions (such as breakpoint and interrupt acknowledge cycles). registers sfc and dfc are used by the moves instruction to specify explicitly the function codes of the memory address. the movec instruction is used to transfer val- ues to and from the alternate function code registers. this is a long-word transfer; the upper 29 bits are read as zeros and are ignored when written. 4.2.5 vector base register (vbr) the vbr contains the base address of the 1024-byte exception vector table, consist- ing of 256 exception vectors. exception vectors contain the memory addresses of routines that begin execution at the completion of exception processing. more information on the vbr and exception processing can be found in 4.9 exception pro- cessing . 4.3 memory organization memory is organized on a byte-addressable basis in which lower addresses corre- spond to higher order bytes. for example, the address n of a long-word data item cor- responds to the address of the most significant byte of the highest order word. the address of the most significant byte of the low-order word is n + 2, and the address of the least significant byte of the long word is n + 3. the cpu32 requires long-word and word data and all instructions to be aligned on word boundaries. refer to figure 4-6 . if this does not happen, an exception will occur when the cpu32 accesses the misaligned instruction or data. data misalignment is not supported. 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-8 user? manual figure 4-6 memory operand addressing bit data 1 byte = 8 bits 1 byte = 8 bits 765 4 32 1 0 msb = most significant bit lsb = least significant bit address 1 address = 32 bits long word = 32 bits word = 16 bits 15 0 word 0 word 1 word 2 high order low order long word 0 msb lsb long word 1 0 lsb msb 15 address 1 address 2 msd = most significant digit lsd = least significant digit decimal data bcd digits = 1 byte 15 12 11 8 7 4 3 0 msd bcd 0 bcd 4 bcd 1 bcd 5 bcd 2 bcd 6 bcd 3 bcd 7 high order low order long word 2 msb byte 0 lsb byte 1 byte 2 byte 3 15 87 0 15 0 address 0 msb word 0 lsb lsd 1125a 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-9 4.4 virtual memory the full addressing range of the cpu32 on the MC68336/376 is 16 mbytes in each of eight address spaces. even though most systems implement a smaller physical mem- ory, the system can be made to appear to have a full 16 mbytes of memory available to each user program by using virtual memory techniques. a system that supports virtual memory has a limited amount of high-speed physical memory that can be accessed directly by the processor and maintains an image of a much larger virtual memory on a secondary storage device. when the processor at- tempts to access a location in the virtual memory map that is not resident in physical memory, a page fault occurs. the access to that location is temporarily suspended while the necessary data is fetched from secondary storage and placed in physical memory. the suspended access is then restarted or continued. the cpu32 uses instruction restart, which requires that only a small portion of the in- ternal machine state be saved. after correcting the fault, the machine state is restored, and the instruction is fetched and started again. this process is completely transpar- ent to the application program. 4.5 addressing modes addressing in the cpu32 is register-oriented. most instructions allow the results of the specified operation to be placed either in a register or directly in memory. there is no need for extra instructions to store register contents in memory. there are seven basic addressing modes: ?register direct ?register indirect ?register indirect with index ?program counter indirect with displacement ?program counter indirect with index ?absolute ?immediate the register indirect addressing modes include postincrement, predecrement, and off- set capability. the program counter indirect mode also has index and offset capabili- ties. in addition to these addressing modes, many instructions implicitly specify the use of the status register, stack pointer, and/or program counter. 4.6 processing states the processor is always in one of four processing states: normal, exception, halted, or background. the normal processing state is associated with instruction execution; the bus is used to fetch instructions and operands and to store results. 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-10 user? manual the exception processing state is associated with interrupts, trap instructions, tracing, and other exception conditions. the exception may be internally generated explicitly by an instruction or by an unusual condition arising during the execution of an instruc- tion. exception processing can be forced externally by an interrupt, a bus error, or a reset. the halted processing state is an indication of catastrophic hardware failure. for ex- ample, if during the exception processing of a bus error another bus error occurs, the processor assumes that the system is unusable and halts. the background processing state is initiated by breakpoints, execution of special in- structions, or a double bus fault. background processing is enabled by pulling bkpt low during reset . background processing allows interactive debugging of the sys- tem via a simple serial interface. 4.7 privilege levels the processor operates at one of two levels of privilege: user or supervisor. not all in- structions are permitted to execute at the user level, but all instructions are available at the supervisor level. effective use of privilege level can protect system resources from uncontrolled access. the state of the s bit in the status register determines the privilege level and whether the user stack pointer (usp) or supervisor stack pointer (ssp) is used for stack operations. 4.8 instructions the cpu32 instruction set is summarized in table 4-2 . the instruction set of the cpu32 is very similar to that of the mc68020. two new instructions have been added to facilitate controller applications: low-power stop (lpstop) and table lookup and in- terpolate (tbls, tblsn, tblu, tblun). table 4-1 shows the mc68020 instructions that are not implemented on the cpu32. the cpu32 traps on unimplemented instructions or illegal effective addressing modes, allowing user-supplied code to emulate unimplemented capabilities or to de- fine special purpose functions. however, motorola reserves the right to use all current- ly unimplemented instruction operation codes for future m68000 core enhancements. table 4-1 unimplemented mc68020 instructions bfxx bit field instructions (bfchg, bfclr, bfexts, bfextu, bfffo, bfins, bfset, bftst) callm, rtm call module, return module cas, cas2 compare and swap (read-modify-write instructions) cpxxx coprocessor instructions (cpbcc, cpdbcc, cpgen) pack, unpk pack, unpack bcd instructions memory memory indirect addressing modes 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-11 table 4-2 instruction set summary abcd dn, dn - (an), - (an) 8 8 source 10 + destination 10 + x destination add dn, , dn 8, 16, 32 8, 16, 32 source + destination destination adda , an 16, 32 source + destination destination addi #, 8, 16, 32 immediate data + destination destination addq # , 8, 16, 32 immediate data + destination destination addx dn, dn - (an), - (an) 8, 16, 32 8, 16, 32 source + destination + x destination and , dn dn, 8, 16, 32 8, 16, 32 source ? destination destination andi # , 8, 16, 32 data ? destination destination andi to ccr # , ccr 8 source ? ccr ccr andi to sr1 1 # , sr 16 source ? sr sr asl dn, dn # , dn 8, 16, 32 8, 16, 32 16 asr dn, dn # , dn 8, 16, 32 8, 16, 32 16 bcc label 8, 16, 32 if condition true, then pc + d pc bchg dn, # , 8, 32 8, 32 bclr dn, # , 8, 32 8, 32 0 bit of destination bgnd none none if background mode enabled, then enter background mode, else format/vector ?- (ssp); pc - (ssp); sr - (ssp); (vector) pc bkpt # none if breakpoint cycle acknowledged, then execute returned operation word, else trap as illegal instruction bra label 8, 16, 32 pc + d pc bset dn, # , 8, 32 8, 32 1 bit of destination bsr label 8, 16, 32 sp - 4 sp; pc ? (sp); pc + d pc btst dn, # , 8, 32 8, 32 chk , dn 16, 32 if dn < 0 or dn > (ea), then chk exception chk2 , rn 8, 16, 32 if rn < lower bound or rn > upper bound, then chk exception clr 8, 16, 32 0 destination cmp , dn 8, 16, 32 (destination - source), ccr shows results cmpa , an 16, 32 (destination - source), ccr shows results cmpi # , 8, 16, 32 (destination - data), ccr shows results cmpm (an) + , (an) + 8, 16, 32 (destination - source), ccr shows results cmp2 , rn 8, 16, 32 lower bound rn upper bound, ccr shows result dbcc dn, label 16 if condition false, then dn - 1 pc; if dn ( - 1), then pc + d pc divs/divu , dn 32/16 16 : 16 destination / source destination (signed or unsigned) x/c 0 x/c bit number of destination () z bit of destination bit number of destination () z; bit number of destination () z; bit number of destination () z 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-12 user? manual divsl/divul , dr : dq , dq , dr : dq 64/32 32 : 32 32/32 32 32/32 32 : 32 destination / source destination (signed or unsigned) eor dn, 8, 16, 32 source destination destination eori # , 8, 16, 32 data destination destination eori to ccr # , ccr 8 source ccr ccr eori to sr 1 # , sr 16 source sr sr exg rn, rn 32 rn rn ext dn dn 8 16 16 32 sign extended destination destination extb dn 8 32 sign extended destination destination illegal none none ssp - 2 ssp; vector offset (ssp); ssp - 4 ssp; pc (ssp); ssp - 2 ssp; sr (ssp); illegal instruction vector address pc jmp none destination pc jsr none sp - 4 sp; pc (sp); destination pc lea , an 32 an link an, # d 16, 32 sp - 4 sp, an (sp); sp an, sp + d sp lpstop 1 # 16 data sr; interrupt mask ebi; stop lsl dn, dn # , dn 8, 16, 32 8, 16, 32 16 lsr dn, dn #, dn 8, 16, 32 8, 16, 32 16 move , 8, 16, 32 source destination movea , an 16, 32 32 source destination movea 1 usp, an an, usp 32 32 usp an an usp move from ccr ccr, 16 ccr destination move to ccr , ccr 16 source ccr move from sr 1 sr, 16 sr destination move to sr 1 , sr 16 source sr move usp 1 usp, an an, usp 32 32 usp an an usp movec 1 rc, rn rn, rc 32 32 rc rn rn rc movem list, , list 16, 32 16, 32 32 listed registers destination source listed registers movep dn, (d16, an) (d16, an), dn 16, 32 dn [31 : 24] (an + d); dn [23 : 16] (an + d + 2); dn [15 : 8] (an + d + 4); dn [7 : 0] (an + d + 6) (an + d) dn [31 : 24]; (an + d + 2) dn [23 : 16]; (an + d + 4) dn [15 : 8]; (an + d + 6) dn [7 : 0] moveq #, dn 8 32 immediate data destination moves 1 rn, , rn 8, 16, 32 rn destination using dfc source using sfc rn muls/mulu , dn , dl , dh : dl 16 * 16 32 32 * 32 32 32 * 32 64 source * destination destination (signed or unsigned) nbcd 8 8 0 - destination 10 - x destination table 4-2 instruction set summary (continued) x/c 0 x/c 0 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-13 neg 8, 16, 32 0 - destination destination negx 8, 16, 32 0 - destination - x destination nop none none pc + 2 pc not 8, 16, 32 destination destination or , dn dn, 8, 16, 32 8, 16, 32 source + destination destination ori #, 8, 16, 32 data + destination destination ori to ccr #, ccr 16 source + ccr sr ori to sr 1 #, sr 16 source ; sr sr pea 32 sp - 4 sp; sp reset 1 none none assert reset line rol dn, dn #, dn 8, 16, 32 8, 16, 32 16 ror dn, dn #, dn 8, 16, 32 8, 16, 32 16 roxl dn, dn #, dn 8, 16, 32 8, 16, 32 16 roxr dn, dn #, dn 8, 16, 32 8, 16, 32 16 rtd #d 16 (sp) pc; sp + 4 + d sp rte 1 none none (sp) sr; sp + 2 sp; (sp) pc; sp + 4 sp; restore stack according to format rtr none none (sp) ccr; sp + 2 sp; (sp) pc; sp + 4 sp rts none none (sp) pc; sp + 4 sp sbcd dn, dn - (an), - (an) 8 8 destination10 - source10 - x destination scc 8 if condition true, then destination bits are set to one; else, destination bits are cleared to zero stop 1 # 16 data sr; stop sub , dn dn, 8, 16, 32 destination - source destination suba , an 16, 32 destination - source destination subi #, 8, 16, 32 destination - data destination subq #, 8, 16, 32 destination - data destination subx dn, dn - (an), - (an) 8, 16, 32 8, 16, 32 destination - source - x destination swap dn 16 tas 8 destination tested condition codes bit 7 of destination tbls/tblu , dn dym : dyn, dn 8, 16, 32 dyn - dym temp (temp * dn [7 : 0]) temp (dym * 256) + temp dn table 4-2 instruction set summary (continued) c c c x c x msw lsw 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-14 user? manual 4.8.1 m68000 family compatibility it is the philosophy of the m68000 family that all user-mode programs can execute un- changed on future derivatives of the m68000 family, and supervisor-mode programs and exception handlers should require only minimal alteration. the cpu32 can be thought of as an intermediate member of the m68000 family. ob- ject code from an mc68000 or mc68010 may be executed on the cpu32. many of the instruction and addressing mode extensions of the mc68020 are also supported. re- fer to the cpu32 reference manual (cpu32rm/ad) for a detailed comparison of the cpu32 and mc68020 instruction set. 4.8.2 special control instructions low-power stop (lpstop) and table lookup and interpolate (tbl) instructions have been added to the mc68000 instruction set for use in controller applications. 4.8.2.1 low-power stop (lpstop) in applications where power consumption is a consideration, the cpu32 forces the de- vice into a low-power standby mode when immediate processing is not required. the low-power stop mode is entered by executing the lpstop instruction. the processor remains in this mode until a user-specified (or higher) interrupt level or reset occurs. 4.8.2.2 table lookup and interpolate (tbl) to maximize throughput for real-time applications, reference data is often precalculat- ed and stored in memory for quick access. storage of many data points can require an inordinate amount of memory. the table lookup instruction requires that only a sample of data points be stored, reducing memory requirements. the tbl instruction recovers intermediate values using linear interpolation. results can be rounded with a round-to-nearest algorithm. notes: 1. privileged instruction. tblsn/tblun , dn dym : dyn, dn 8, 16, 32 dyn - dym temp (temp * dn [7 : 0]) / 256 temp dym + temp dn trap # none ssp - 2 ssp; format/vector offset (ssp); ssp - 4 ssp; pc (ssp); sr (ssp); vector address pc trapcc none # none 16, 32 if cc true, then trap exception trapv none none if v set, then overflow trap exception tst 8, 16, 32 source - 0, to set condition codes unlk an 32 an sp; (sp) an, sp + 4 sp table 4-2 instruction set summary (continued) 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-15 4.8.2.3 loop mode instruction execution the cpu32 has several features that provide efficient execution of program loops. one of these features is the dbcc looping primitive instruction. to increase the perfor- mance of the cpu32, a loop mode has been added to the processor. the loop mode is used by any single word instruction that does not change the program flow. loop mode is implemented in conjunction with the dbcc instruction. figure 4-7 shows the required form of an instruction loop for the processor to enter loop mode. figure 4-7 loop mode instruction sequence the loop mode is entered when the dbcc instruction is executed, and the loop dis- placement is ?. once in loop mode, the processor performs only the data cycles as- sociated with the instruction and suppresses all instruction fetches. the termination condition and count are checked after each execution of the data operations of the looped instruction. the cpu32 automatically exits the loop mode on interrupts or other exceptions. all single word instructions that do not cause a change of flow can be looped. 4.9 exception processing an exception is a special condition that preempts normal processing. exception pro- cessing is the transition from normal mode program execution to execution of a routine that deals with an exception. 4.9.1 exception vectors an exception vector is the address of a routine that handles an exception. the vector base register (vbr) contains the base address of a 1024-byte exception vector table, which consists of 256 exception vectors. sixty-four vectors are defined by the processor, and 192 vectors are reserved for user definition as interrupt vectors. except for the reset vector, each vector in the table is one long word in length. the reset vector is two long words in length. refer to table 4-3 for information on vector assignment. caution because there is no protection on the 64 processor-defined vectors, external devices can access vectors reserved for internal purposes. this practice is strongly discouraged. one word instruction dbcc dbcc displacement $fffc = ?4 1126a 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-16 user? manual all exception vectors, except the reset vector and stack pointer, are located in super- visor data space. the reset vector and stack pointer are located in supervisor program space. only the initial reset vector and stack pointer are fixed in the processor memory map. when initialization is complete, there are no fixed assignments. since the vbr stores the vector table base address, the table can be located anywhere in memory. it can also be dynamically relocated for each task executed by an operating system. each vector is assigned an 8-bit number. vector numbers for some exceptions are ob- tained from an external device; others are supplied by the processor. the processor multiplies the vector number by four to calculate vector offset, then adds the offset to the contents of the vbr. the sum is the memory address of the vector. table 4-3 exception vector assignments vector number vector offset assignment dec hex space 0 0 000 sp reset: initial stack pointer 1 4 004 sp reset: initial program counter 2 8 008 sd bus error 3 12 00c sd address error 4 16 010 sd illegal instruction 5 20 014 sd zero division 6 24 018 sd chk, chk2 instructions 7 28 01c sd trapcc, trapv instructions 8 32 020 sd privilege violation 9 36 024 sd trace 10 40 028 sd line 1010 emulator 11 44 02c sd line 1111 emulator 12 48 030 sd hardware breakpoint 13 52 034 sd (reserved, coprocessor protocol violation) 14 56 038 sd format error and uninitialized interrupt 15 60 03c sd format error and uninitialized interrupt 16?3 64 92 040 05c sd (unassigned, reserved) 24 96 060 sd spurious interrupt 25 100 064 sd level 1 interrupt autovector 26 104 068 sd level 2 interrupt autovector 27 108 06c sd level 3 interrupt autovector 28 112 070 sd level 4 interrupt autovector 29 116 074 sd level 5 interrupt autovector 30 120 078 sd level 6 interrupt autovector 31 124 07c sd level 7 interrupt autovector 32?7 128 188 080 0bc sd trap instruction vectors (0?5) 48?8 192 232 0c0 0e8 sd (reserved, coprocessor) 59?3 236 252 0ec 0fc sd (unassigned, reserved) 64?55 256 1020 100 3fc sd user defined vectors (192) 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-17 4.9.2 types of exceptions an exception can be caused by internal or external events. an internal exception can be generated by an instruction or by an error. the trap, trapcc, trapv, bkpt, chk, chk2, rte, and div instructions can cause excep- tions during normal execution. illegal instructions, instruction fetches from odd ad- dresses, word or long-word operand accesses from odd addresses, and privilege violations also cause internal exceptions. sources of external exception include interrupts, breakpoints, bus errors, and reset re- quests. interrupts are peripheral device requests for processor action. breakpoints are used to support development equipment. bus error and reset are used for access con- trol and processor restart. 4.9.3 exception processing sequence for all exceptions other than a reset exception, exception processing occurs in the fol- lowing sequence. refer to 5.7 reset for details of reset processing. as exception processing begins, the processor makes an internal copy of the status register. after the copy is made, the processor state bits in the status register are changed ?the s bit is set, establishing supervisor access level, and bits t1 and t0 are cleared, disabling tracing. for reset and interrupt exceptions, the interrupt priority mask is also updated. next, the exception number is obtained. for interrupts, the number is fetched from cpu space $f (the bus cycle is an interrupt acknowledge). for all other exceptions, internal logic provides a vector number. next, current processor status is saved. an exception stack frame is created and placed on the supervisor stack. all stack frames contain copies of the status register and the program counter for use by rte. the type of exception and the context in which the exception occurs determine what other information is stored in the stack frame. finally, the processor prepares to resume normal execution of instructions. the ex- ception vector offset is determined by multiplying the vector number by four, and the offset is added to the contents of the vbr to determine displacement into the excep- tion vector table. the exception vector is loaded into the program counter. if no other exception is pending, the processor will resume normal execution at the new address in the pc. 4.10 development support the following features have been implemented on the cpu32 to enhance the instru- mentation and development environment: ?m68000 family development support ?background debug mode ?deterministic opcode tracking ?hardware breakpoints 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-18 user? manual 4.10.1 m68000 family development support all m68000 family members include features to facilitate applications development. these features include the following: trace on instruction execution ?m68000 family processors include an instruction- by-instruction tracing facility as an aid to program development. the mc68020, mc68030, mc68040, and cpu32 also allow tracing only of those instructions causing a change in program flow. in the trace mode, a trace exception is generated after an instruction is executed, allowing a debugger program to monitor the execution of a pro- gram under test. breakpoint instruction ?an emulator may insert software breakpoints into the target code to indicate when a breakpoint has occurred. on the mc68010, mc68020, mc68030, and cpu32, this function is provided via illegal instructions, $4848?484f, to serve as breakpoint instructions. unimplemented instruction emulation ?during instruction execution, when an at- tempt is made to execute an illegal instruction, an illegal instruction exception occurs. unimplemented instructions (f-line, a-line, . . .) utilize separate exception vectors to permit efficient emulation of unimplemented instructions in software. 4.10.2 background debug mode microcomputer systems generally provide a debugger, implemented in software, for system analysis at the lowest level. the background debug mode (bdm) on the cpu32 is unique in that the debugger has been implemented in cpu microcode. bdm incorporates a full set of debugging options: registers can be viewed or altered, memory can be read or written to, and test features can be invoked. a resident debugger simplifies implementation of an in-circuit emulator. in a common setup (refer to figure 4-8 ), emulator hardware replaces the target system processor. a complex, expensive pod-and-cable interface provides a communication path be- tween the target system and the emulator. by contrast, an integrated debugger supports use of a bus state analyzer (bsa) for incircuit emulation. the processor remains in the target system (refer to figure 4-9 ) and the interface is simplified. the bsa monitors target processor operation and the on-chip debugger controls the operating environment. emulation is much ?loser?to target hardware, and many interfacing problems (for example, limitations on high- frequency operation, ac and dc parametric mismatches, and restrictions on cable length) are minimized. 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-19 figure 4-8 common in-circuit emulator diagram figure 4-9 bus state analyzer configuration 4.10.3 enabling bdm accidentally entering bdm in a non-development environment can lock up the cpu32 when the serial command interface is not available. for this reason, bdm is enabled during reset via the breakpoint (bkpt ) signal. bdm operation is enabled when bkpt is asserted (low), at the rising edge of reset . bdm remains enabled until the next system reset. a high bkpt signal on the trailing edge of reset disables bdm. bkpt is latched again on each rising transition of re set . bkpt is synchronized internally, and must be held low for at least two clock cycles prior to negation of reset . bdm enable logic must be designed with special care. if hold time on bkpt (after the trailing edge of reset ) extends into the first bus cycle following reset, the bus cycle could inadvertently be tagged with a breakpoint. refer to the sim reference manual (simrm/ad) for timing information. 4.10.4 bdm sources when bdm is enabled, any of several sources can cause the transition from normal mode to bdm. these sources include external breakpoint hardware, the bgnd instruction, a double bus fault, and internal peripheral breakpoints. if bdm is not en- abled when an exception condition occurs, the exception is processed normally. 1128a target system in-circuit emulator target mcu 1129a bus state analyzer target system target mcu 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-20 user? manual table 4-4 summarizes the processing of each source for both enabled and disabled cases. as shown in table 4-4 , the bkpt instruction never causes a transition into bdm. 4.10.4.1 external bkpt signal once enabled, bdm is initiated whenever assertion of bkpt is acknowledged. if bdm is disabled, a breakpoint exception (vector $0c) is acknowledged. the bkpt input has the same timing relationship to the data strobe trailing edge as does read cycle data. there is no breakpoint acknowledge bus cycle when bdm is entered. 4.10.4.2 bgnd instruction an illegal instruction, $4afa, is reserved for use by development tools. the cpu32 defines $4afa (bgnd) to be a bdm entry point when bdm is enabled. if bdm is disabled, an illegal instruction trap is acknowledged. 4.10.4.3 double bus fault the cpu32 normally treats a double bus fault, or two bus faults in succession, as a catastrophic system error, and halts. when this condition occurs during initial system debug (a fault in the reset logic), further debugging is impossible until the problem is corrected. in bdm, the fault can be temporarily bypassed, so that the origin of the fault can be isolated and eliminated. 4.10.4.4 peripheral breakpoints cpu32 peripheral breakpoints are implemented in the same way as external break- points ?peripherals request breakpoints by asserting the bkpt signal. consult the appropriate peripheral user? manual for additional details on the generation of peripheral breakpoints. 4.10.5 entering bdm when the processor detects a breakpoint or a double bus fault, or decodes a bgnd instruction, it suspends instruction execution and asserts the freeze output. this is the first indication that the processor has entered bdm. once freeze has been as- serted, the cpu enables the serial communication hardware and awaits a command. the cpu writes a unique value indicating the source of bdm transition into temporary register a (atemp) as part of the process of entering bdm. a user can poll atemp and determine the source (refer to table 4-5 ) by issuing a read system register com- mand (rsreg). atemp is used in most debugger commands for temporary storage table 4-4 bdm source summary source bdm enabled bdm disabled bkpt background breakpoint exception double bus fault background halted bgnd instruction background illegal instruction bkpt instruction opcode substitution/ illegal instruction opcode substitution/ illegal instruction 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-21 ?it is imperative that the rsreg command be the first command issued after tran- sition into bdm. a double bus fault during initial stack pointer/program counter (sp/pc) fetch sequence is distinguished by a value of $ffffffff in the current instruction pc. at no other time will the processor write an odd value into this register. 4.10.6 bdm commands bdm commands consist of one 16-bit operation word and can include one or more 16- bit extension words. each incoming word is read as it is assembled by the serial inter- face. the microcode routine corresponding to a command is executed as soon as the command is complete. result operands are loaded into the output shift register to be shifted out as the next command is read. this process is repeated for each command until the cpu returns to normal operating mode. table 4-6 is a summary of back- ground mode commands. notes: 1. special status word (ssw) is described in detail in the cpu32 reference manual (cpu32rm/ad). table 4-5 polling the bdm entry source source atemp[31:16] atemp[15:0] double bus fault ssw 1 $ffff bgnd instruction $0000 $0001 hardware breakpoint $0000 $0000 336376umbook page 21 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-22 user? manual 4.10.7 background mode registers bdm processing uses three special purpose registers to keep track of program context during development. a description of each follows. 4.10.7.1 fault address register (far) the far contains the address of the faulting bus cycle immediately following a bus or address error. this address remains available until overwritten by a subsequent bus cycle. following a double bus fault, the far contains the address of the last bus cycle. the address of the first fault (if there was one) is not visible to the user. 4.10.7.2 return program counter (rpc) the rpc points to the location where fetching will commence after transition from background mode to normal mode. this register should be accessed to change the flow of a program under development. changing the rpc to an odd value will cause an address error when normal mode prefetching begins. table 4-6 background mode command summary command mnemonic description read d/a register rdreg/rareg read the selected address or data register and return the results via the serial interface. write d/a register wdreg/wareg the data operand is written to the specified address or data register. read system register rsreg the specified system control register is read. all registers that can be read in supervisor mode can be read in background mode. write system register wsreg the operand data is written into the specified system control register. read memory location read read the sized data at the memory location specified by the long-word address. the source function code register (sfc) determines the address space accessed. write memory location write write the operand data to the memory location specified by the long-word address. the destination function code (dfc) reg- ister determines the address space accessed. dump memory block dump used in conjunction with the read command to dump large blocks of memory. an initial read is executed to set up the starting address of the block and retrieve the first result. sub- sequent operands are retrieved with the dump command. fill memory block fill used in conjunction with the write command to fill large blocks of memory. an initial write is executed to set up the starting address of the block and supply the first operand. sub- sequent operands are written with the fill command. resume execution go the pipe is flushed and re-filled before resuming instruction execution at the current pc. patch user code call current program counter is stacked at the location of the cur- rent stack pointer. instruction execution begins at user patch code. reset peripherals rst asserts reset for 512 clock cycles. the cpu is not reset by this command. synonymous with the cpu reset instruction. no operation nop nop performs no operation and may be used as a null com- mand. 336376umbook page 22 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-23 4.10.7.3 current instruction program counter (pcc) the pcc holds a pointer to the first word of the last instruction executed prior to tran- sition into background mode. due to instruction pipelining, the instruction pointed to may not be the instruction which caused the transition. an example is a breakpoint on a released write. the bus cycle may overlap as many as two subsequent instructions before stalling the instruction sequencer. a breakpoint asserted during this cycle will not be acknowledged until the end of the instruction executing at completion of the bus cycle. pcc will contain $00000001 if bdm is entered via a double bus fault immedi- ately out of reset. 4.10.8 returning from bdm bdm is terminated when a resume execution (go) or call user code (call) command is received. both go and call flush the instruction pipeline and refetch instructions from the location pointed to by the rpc. the return pc and the memory space referred to by the status register supv bit reflect any changes made during bdm. freeze is negated prior to initiating the first pre- fetch. upon negation of freeze, the serial subsystem is disabled, and the signals re- vert to ipipe /ifetch functionality. 4.10.9 serial interface communication with the cpu32 during bdm occurs via a dedicated serial interface, which shares pins with other development features. figure 4-10 is a block diagram of the interface. the bkpt signal becomes the serial clock (dsclk); serial input data (dsi) is received on ifetch , and serial output data (dso) is transmitted on ipipe . 336376umbook page 23 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-24 user? manual figure 4-10 debug serial i/o block diagram the serial interface uses a full-duplex synchronous protocol similar to the serial pe- ripheral interface (spi) protocol. the development system serves as the master of the serial link since it is responsible for the generation of dsclk. if dsclk is derived from the cpu32 system clock, development system serial logic is unhindered by the oper- ating frequency of the target processor. operable frequency range of the serial clock is from dc to one-half the processor system clock frequency. the serial interface operates in full-duplex mode ?data is transmitted and received simultaneously by both master and slave devices. in general, data transitions occur on the falling edge of dsclk and are stable by the following rising edge of dsclk. data is transmitted msb first, and is latched on the rising edge of dsclk. the serial data word is 17 bits wide, including 16 data bits and a status/control bit (refer to figure 4-11 ). bit 16 indicates the status of cpu-generated messages. table 4-7 shows the cpu-generated message types. control logic serial in parallel out parallel in serial out execution unit status synchronize microsequencer parallel in serial out serial in parallel out result latch control logic status data dsi dso dsclk serial clock 16 16 rcv data latch cpu instruction register bus 16 command latch data 16 0 m development system 32 debug i/o block 336376umbook page 24 friday, november 15, 1996 2:09 pm
MC68336/376 central processor unit motorola user? manual 4-25 figure 4-11 bdm serial data word command and data transfers initiated by the development system should clear bit 16. the current implementation ignores this bit; however, motorola reserves the right to use this bit for future enhancements. 4.10.10 recommended bdm connection in order to provide for use of development tools when an mcu is installed in a system, motorola recommends that appropriate signal lines be routed to a male berg connec- tor or double-row header installed on the circuit board with the mcu, as shown in the following figure. figure 4-12 bdm connector pinout table 4-7 cpu generated message encoding bit 16 data message type 0 xxxx valid data transfer 0 ffff command complete; status ok 1 0000 not ready with response; come again 1 0001 berr terminated bus cycle; data invalid 1 ffff illegal command bdm serial data word 15 16 s/c 0 data field status control bit 32 berg ds gnd gnd reset v dd berr bkpt /dsclk freeze ifetch /dsi ipipe /dso 1 3 5 7 9 2 4 6 8 10 336376umbook page 25 friday, november 15, 1996 2:09 pm
motorola central processor unit MC68336/376 4-26 user? manual 4.10.11 deterministic opcode tracking cpu32 function code outputs are augmented by two supplementary signals to monitor the instruction pipeline. the instruction pipe (ipipe ) output indicates the start of each new instruction and each mid-instruction pipeline advance. the instruction fetch (if etch ) output identifies the bus cycles in which the operand is loaded into the in- struction pipeline. pipeline flushes are also signaled with ifetch . monitoring these two signals allows a bus state analyzer to synchronize itself to the instruction stream and monitor its activity. 4.10.12 on-chip breakpoint hardware an external breakpoint input and on-chip breakpoint hardware allow a breakpoint trap on any memory access. off-chip address comparators preclude breakpoints unless show cycles are enabled. breakpoints on instruction prefetches that are ultimately flushed from the instruction pipeline are not acknowledged; operand breakpoints are always acknowledged. acknowledged breakpoints initiate exception processing at the address in exception vector number 12, or alternately enter background mode. 336376umbook page 26 friday, november 15, 1996 2:09 pm
MC68336/376 system integration module motorola user? manual 5-1 section 5 system integration module this section is an overview of the system integration module (sim) function. refer to the sim reference manual (simrm/ad) for a comprehensive discussion of sim ca- pabilities. refer to d.2 system integration module for information concerning the sim address map and register structure. 5.1 general the sim consists of six functional blocks. figure 5-1 shows a block diagram of the sim. the system configuration block controls mcu configuration parameters. the system clock generates clock signals used by the sim, other imb modules, and external devices. the system protection block provides bus and software watchdog monitors. in addi- tion, it also provides a periodic interrupt timer to support execution of time-critical con- trol routines. the external bus interface handles the transfer of information between imb modules and external address space. the chip-select block provides 12 chip-select signals. each chip-select signal has an associated base address register and option register that contain the programmable characteristics of that chip-select. the system test block incorporates hardware necessary for testing the mcu. it is used to perform factory tests, and its use in normal applications is not supported.
motorola system integration module MC68336/376 5-2 user? manual figure 5-1 system integration module block diagram 5.2 system configuration the sim configuration register (simcr) governs several aspects of system operation. the following paragraphs describe those configuration options controlled by simcr. 5.2.1 module mapping control registers for all the modules in the microcontroller are mapped into a 4-kbyte block. the state of the module mapping bit (mm) in the sim configuration register (simcr) determines where the control register block is located in the system memory map. when mm = 0, register addresses range from $7ff000 to $7fffff; when mm = 1, register addresses range from $fff000 to $ffffff. 5.2.2 interrupt arbitration each module that can request interrupts has an interrupt arbitration (iarb) field. arbi- tration between interrupt requests of the same priority is performed by serial conten- tion between iarb field bit values. contention must take place whenever an interrupt request is acknowledged, even when there is only a single request pending. for an interrupt to be serviced, the appropriate iarb field must have a non-zero value. if an interrupt request from a module with an iarb field value of %0000 is recognized, the cpu32 processes a spurious interrupt exception. 300 s(c)im block system configuration clock synthesizer chip-selects external bus interface factory test clkout extal modclk chip-selects external bus reset tstme /tsc freeze/quot xtal system protection
MC68336/376 system integration module motorola user? manual 5-3 because the sim routes external interrupt requests to the cpu32, the sim iarb field value is used for arbitration between internal and external interrupts of the same pri- ority. the reset value of iarb for the sim is %1111, and the reset iarb value for all other modules is %0000, which prevents sim interrupts from being discarded during initialization. refer to 5.8 interrupts for a discussion of interrupt arbitration. 5.2.3 show internal cycles a show cycle allows internal bus transfers to be monitored externally. the shen field in simcr determines what the external bus interface does during internal transfer op- erations. table 5-1 shows whether data is driven externally, and whether external bus arbitration can occur. refer to 5.6.6.1 show cycles for more information. 5.2.4 register access the cpu32 can operate at one of two privilege levels. supervisor level is more privi- leged than user level ?all instructions and system resources are available at super- visor level, but access is restricted at user level. effective use of privilege level can protect system resources from uncontrolled access. the state of the s bit in the cpu status register determines access level, and whether the user or supervisor stack pointer is used for stacking operations. the supv bit places sim global registers in either supervisor or user data space. when supv = 0, registers with controlled access are accessible from either the user or supervisor privilege level; when supv = 1, reg- isters with controlled access are restricted to supervisor access only. 5.2.5 freeze operation the freeze signal halts mcu operations during debugging. freeze is asserted in- ternally by the cpu32 if a breakpoint occurs while background mode is enabled. when freeze is asserted, only the bus monitor, software watchdog, and periodic interrupt timer are affected. the halt monitor and spurious interrupt monitor continue to operate normally. setting the freeze bus monitor (frzbm) bit in simcr disables the bus mon- itor when freeze is asserted. setting the freeze software watchdog (frzsw) bit dis- ables the software watchdog and the periodic interrupt timer when freeze is asserted. table 5-1 show cycle enable bits shen[1:0] action 00 show cycles disabled, external arbitration enabled 01 show cycles enabled, external arbitration disabled 10 show cycles enabled, external arbitration enabled 11 show cycles enabled, external arbitration enabled; internal activity is halted by a bus grant
motorola system integration module MC68336/376 5-4 user? manual 5.3 system clock the system clock in the sim provides timing signals for the imb modules and for an external peripheral bus. because the mcu is a fully static design, register and memory contents are not affected when the clock rate changes. system hardware and software support changes in clock rate during operation. the system clock signal can be generated from one of two sources. an internal phase- locked loop (pll) can synthesize the clock from a fast reference, or the clock signal can be directly input from an external frequency source. the fast reference is typically a 4.194 mhz crystal, but may be generated by sources other than a crystal. keep these sources in mind while reading the rest of this section. refer to table a-4 in the appendix a electrical characteristics for clock specifications. figure 5-2 is a block diagram of the clock submodule. figure 5-2 system clock block diagram 5.3.1 clock sources the state of the clock mode (modclk) pin during reset determines the system clock source. when modclk is held high during reset, the clock synthesizer generates a clock signal from an external reference frequency. the clock synthesizer control reg- ister (syncr) determines operating frequency and mode of operation. when mod- clk is held low during reset, the clock synthesizer is disabled and an external system clock signal must be driven onto the extal pin. the input clock is referred to as f ref , and can be either a crystal or an external clock source. the output of the clock system is referred to as f sys . ensure that f ref and f sys are within normal operating limits. 16/32 pll block 4m phase comparator low-pass filter vco crystal oscillator system clock system clock control feedback divider w x y extal xtal xfc clkout ? 128 modclk v ddsyn
MC68336/376 system integration module motorola user? manual 5-5 to generate a reference frequency using the crystal oscillator, a reference crystal must be connected between the extal and xtal pins. typically, a 4.194 mhz crystal is used, but the frequency may vary between 1 and 6 mhz. figure 5-3 shows a typical circuit. figure 5-3 system clock oscillator circuit if a fast reference frequency is provided to the pll from a source other than a crystal, or an external system clock signal is applied through the extal pin, the xtal pin must be left floating. when an external system clock signal is applied (modclk = 0 during reset), the pll is disabled. the duty cycle of this signal is critical, especially at operating frequencies close to maximum. the relationship between clock signal duty cycle and clock signal period is expressed as follows: 5.3.2 clock synthesizer operation v ddsyn is used to power the clock circuits when the system clock is synthesized from either a crystal or an externally supplied reference frequency. a separate power source increases mcu noise immunity and can be used to run the clock when the mcu is powered down. a quiet power supply must be used as the v ddsyn source. ad- equate external bypass capacitors should be placed as close as possible to the v ddsyn pin to assure a stable operating frequency. when an external system clock signal is applied and the pll is disabled, v ddsyn should be connected to the v dd sup- ply. refer to the sim reference manual (simrm/ad) for more information regarding system clock power supply conditioning. 32 oscillator 4m extal xtal 1 m w 1.5 k w 27 pf* 27 pf* v ss resistance and capacitance based on a test circuit constructed with a kds041-18 4.194 mhz crystal. specific components must be based on crystal type. contact crystal vendor for exact circuit. * r1 c1 c2 r2 minimum external clock period minimum external clock high/low time 50% percentage variation of external clock input duty cycle ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ =
motorola system integration module MC68336/376 5-6 user? manual a voltage controlled oscillator (vco) in the pll generates the system clock signal. to maintain a 50% clock duty cycle, the vco frequency (f vco ) is either two or four times the system clock frequency, depending on the state of the x bit in syncr. the clock signal is fed back to a divider/counter. the divider controls the frequency of one input to a phase comparator. the other phase comparator input is a reference signal, either from the crystal oscillator or from an external source. the comparator generates a con- trol signal proportional to the difference in phase between the two inputs. this signal is low-pass filtered and used to correct the vco output frequency. filter circuit implementation can vary, depending upon the external environment and required clock stability. figure 5-4 shows two recommended system clock filter networks. xfc pin leakage must be kept as low as possible to maintain optimum sta- bility and pll performance. an external filter network connected to the xfc pin is not required when an external system clock signal is applied and the pll is disabled (modclk = 0 at reset). the xfc pin must be left floating in this case. figure 5-4 system clock filter networks the synthesizer locks when the vco frequency is equal to f ref . lock time is affected by the filter time constant and by the amount of difference between the two comparator inputs. whenever a comparator input changes, the synthesizer must relock. lock sta- tus is shown by the slock bit in syncr. during power-up, the mcu does not come out of reset until the synthesizer locks. crystal type, characteristic frequency, and lay- out of external oscillator circuitry affect lock time. normal/high-stability xfc conn 1. maintain low leakage on the xfc node. refer to appendix a electrical characteristics for more information. v ddsyn 0.01 m f 0.1 m f xfc 1 v ss 0.1 m f c4 c3 c1 v ddsyn 0.01 m f 0.1 m f xfc 1, 2 v ss 0.1 m f c4 c3 c1 18 k w r1 0.01 m f c2 normal operating environment high-stability operating environment 2. recommended loop filter for reduced sensitivity to low frequency noise.
MC68336/376 system integration module motorola user? manual 5-7 when the clock synthesizer is used, syncr determines the system clock frequency and certain operating parameters. the w and y[5:0] bits are located in the pll feed- back path, enabling frequency multiplication by a factor of up to 256. when the w or y values change, vco frequency changes, and there is a vco relock delay. the syn- cr x bit controls a divide-by circuit that is not in the synthesizer feedback loop. when x = 0 (reset state), a divide-by-four circuit is enabled, and the system clock frequency is one-fourth the vco frequency (f vco ). when x = 1, a divide-by-two circuit is enabled and system clock frequency is one-half the vco frequency (f vco ). there is no relock delay when clock speed is changed by the x bit. clock frequency is determined by syncr bit settings as follows: the reset state of syncr ($3f00) results in a power-on f sys of 8.388 mhz when f ref is 4.194 mhz. for the device to operate correctly, the clock frequency selected by the w, x, and y bits must be within the limits specified for the mcu. internal vco frequency is determined by the following equations: or table 5-2 shows clock control multipliers for all possible combinations of syncr bits. to obtain clock frequency, find counter modulus in the leftmost column, then multiply the reference frequency by the value in the appropriate prescaler cell. shaded cells exceed the maximum system clock frequency at the time of manual publication; how- ever, they may be usable in the future. refer to appendix a electrical char- acteristics for maximum allowable clock rate. table 5-3 shows clock frequencies available with a 4.194 mhz reference and a max- imum specified clock frequency of 20.97 mhz. to obtain clock frequency, find counter modulus in the leftmost column, then refer to appropriate prescaler cell. shaded cells exceed the maximum system clock frequency at the time of manual publication; how- ever, they may be usable in the future. refer to appendix a electrical char- acteristics for maximum system frequency (f sys ). f sys f ref 128 --------- - 4y 1 + () 2 2w x + () () [] = f vco 4f sys if x = 0 = f vco 2f sys if x = 1 =
motorola system integration module MC68336/376 5-8 user? manual table 5-2 clock control multipliers modulus prescalers y [w:x] = 00 [w:x] = 01 [w:x] = 10 [w:x] = 11 000000 .03125 .625 .125 .25 000001 .0625 .125 .25 .5 000010 .09375 .1875 .375 .75 000011 .125 .25 .5 1 000100 .15625 .3125 .625 1.25 000101 .1875 .375 .75 1.5 000110 .21875 .4375 .875 1.75 000111 .25 .5 1 2 001000 .21825 .5625 1.125 2.25 001001 .3125 .625 1.25 2.5 001010 .34375 .6875 1.375 2.75 001011 .375 .75 1.5 3 001100 .40625 .8125 1.625 3.25 001101 .4375 .875 1.75 3.5 001110 .46875 .9375 1.875 3.75 001111 .5 1 2 4 010000 .53125 1.0625 2.125 4.25 010001 .5625 1.125 2.25 4.5 010010 .59375 1.1875 2.375 4.75 010011 .625 1.25 2.5 5 010100 .65625 1.3125 2.625 5.25 010101 .6875 1.375 2.75 5.5 010110 .71875 1.4375 2.875 5.75 010111 .75 1.5 3 6 011000 .78125 1.5625 3.125 6.25 011001 .8125 1.625 3.25 6.5 011010 .84375 1.6875 3.375 6.75 011011 .875 1.75 3.5 7 011100 .90625 1.8125 3.625 7.25 011101 .9375 1.875 3.75 7.5 011110 .96875 1.9375 3.875 7.75 011111 1 2 4 8
MC68336/376 system integration module motorola user? manual 5-9 100000 1.03125 2.0625 4.125 8.25 100001 1.0625 2.125 4.25 8.5 100010 1.09375 2.1875 4.375 8.75 100011 1.125 2.25 4.5 9 100100 1.15625 2.3125 4.675 9.25 100101 1.1875 2.375 4.75 9.5 100110 1.21875 2.4375 4.875 9.75 100111 1.25 2.5 5 10 101000 1.28125 2.5625 5.125 10.25 101001 1.3125 2.625 5.25 10.5 101010 1.34375 2.6875 5.375 10.75 101011 1.375 2.75 5.5 11 101100 1.40625 2.8125 5.625 11.25 101101 1.4375 2.875 5.75 11.5 101110 1.46875 2.9375 5.875 11.75 101111 1.5 3 6 12 110000 1.53125 3.0625 6.125 12.25 110001 1.5625 3.125 6.25 12.5 110010 1.59375 3.1875 6.375 12.75 110011 1.625 3.25 6.5 13 110100 1.65625 3.3125 6.625 13.25 110101 1.6875 3.375 6.75 13.5 110110 1.71875 3.4375 6.875 13.75 110111 1.75 3.5 7 14 111000 1.78125 3.5625 7.125 14.25 111001 1.8125 3.625 7.25 14.5 111010 1.84375 3.6875 7.375 14.75 111011 1.875 3.75 7.5 15 111100 1.90625 3.8125 7.625 15.25 111101 1.9375 3.875 7.75 15.5 111110 1.96875 3.9375 7.875 15.75 111111 2 4 8 16 table 5-2 clock control multipliers (continued) modulus prescalers y [w:x] = 00 [w:x] = 01 [w:x] = 10 [w:x] = 11
motorola system integration module MC68336/376 5-10 user? manual table 5-3 system frequencies from 4.194 mhz reference modulus prescaler y [w:x] = 00 [w:x] = 01 [w:x] = 10 [w:x] = 11 000000 131 khz 262 khz 524 khz 1049 khz 000001 262 524 1049 2097 000010 393 786 1573 3146 000011 524 1049 2097 4194 000100 655 1311 2621 5243 000101 786 1573 3146 6291 000110 918 1835 3670 7340 000111 1049 2097 4194 8389 001000 1180 2359 4719 9437 001001 1311 2621 5243 10486 001010 1442 2884 5767 11534 001011 1573 3146 6291 12583 001100 1704 3408 6816 13631 001101 1835 3670 7340 14680 001110 1966 3932 7864 15729 001111 2097 4194 8389 16777 010000 2228 4456 8913 17826 010001 2359 4719 9437 18874 010010 2490 4981 9961 19923 010011 2621 5243 10486 20972 010100 2753 5505 11010 22020 010101 2884 5767 11534 23069 010110 3015 6029 12059 24117 010111 3146 6291 12583 25166 011000 3277 6554 13107 26214 011001 3408 6816 13631 27263 011010 3539 7078 14156 28312 011011 3670 7340 14680 29360 011100 3801 7602 15204 30409 011101 3932 7864 15729 31457 011110 4063 8126 16253 32506 011111 4194 8389 16777 33554
MC68336/376 system integration module motorola user? manual 5-11 100000 4325 khz 8651 khz 17302 khz 34603 khz 100001 4456 8913 17826 35652 100010 4588 9175 18350 36700 100011 4719 9437 18874 37749 100100 4850 9699 19399 38797 100101 4981 9961 19923 39846 100110 5112 10224 20447 40894 100111 5243 10486 20972 41943 101000 5374 10748 21496 42992 101001 5505 11010 22020 44040 101010 5636 11272 22544 45089 101011 5767 11534 23069 46137 101100 5898 11796 23593 47186 101101 6029 12059 24117 48234 101110 6160 12321 24642 49283 101111 6291 12583 25166 50332 110000 6423 12845 25690 51380 110001 6554 13107 26214 52428 110010 6685 13369 26739 53477 110011 6816 13631 27263 54526 110100 6947 13894 27787 55575 110101 7078 14156 28312 56623 110110 7209 14418 28836 57672 110111 7340 14680 29360 58720 111000 7471 14942 2988 59769 111001 7602 15204 30409 60817 111010 7733 15466 30933 61866 111011 7864 15729 31457 62915 111100 7995 15991 31982 63963 111101 8126 16253 32506 65011 111110 8258 16515 33030 66060 111111 8389 16777 33554 67109 table 5-3 system frequencies from 4.194 mhz reference (continued) modulus prescaler y [w:x] = 00 [w:x] = 01 [w:x] = 10 [w:x] = 11
motorola system integration module MC68336/376 5-12 user? manual 5.3.3 external bus clock the state of the e-clock division bit (ediv) in syncr determines clock rate for the e- clock signal (eclk) available on pin addr23. eclk is a bus clock for m6800 devices and peripherals. eclk frequency can be set to system clock frequency divided by eight or system clock frequency divided by sixteen. the clock is enabled by the cs10 field in chip-select pin assignment register 1 (cspar1). eclk operation during low- power stop is described in the following paragraph. refer to 5.9 chip-selects for more information about the external bus clock. 5.3.4 low-power operation low-power operation is initiated by the cpu32. to reduce power consumption selec- tively, the cpu can set the stop bits in each module configuration register. to mini- mize overall microcontroller power consumption, the cpu can execute the lpstop instruction, which causes the sim to turn off the system clock. when individual module stop bits are set, clock signals inside each module are turned off, but module registers are still accessible. when the cpu executes lpstop, a special cpu space bus cycle writes a copy of the current interrupt mask into the clock control logic. the sim brings the mcu out of low-power stop mode when one of the following exceptions occur: ?reset ?trace ?sim interrupt of higher priority than the stored interrupt mask refer to 5.6.4.2 lpstop broadcast cycle and 4.8.2.1 low-power stop (lpstop) for more information. during low-power stop mode, unless the system clock signal is supplied by an external source and that source is removed, the sim clock control logic and the sim clock sig- nal (simclk) continue to operate. the periodic interrupt timer and input logic for the reset and irq pins are clocked by simclk, and can be used to bring the processor out of lpstop. optionally, the sim can also continue to generate the clkout signal while in low-power stop mode. stsim and stext bits in syncr determine clock operation during low-power stop mode. the flowchart shown in figure 5-5 summarizes the effects of the stsim and stext bits when the mcu enters normal low power stop mode. any clock in the off state is held low. if the synthesizer vco is turned off during low-power stop mode, there is a pll relock delay after the vco is turned back on.
MC68336/376 system integration module motorola user? manual 5-13 figure 5-5 lpstop flowchart using external clock? no yes use system clock as simclk in lpstop? no yes set stsim = 1 f simclk 1 = f sys in lpstop want clkout on in lpstop? no yes no yes want clkout on in lpstop? set stsim = 0 f simclk 1 = f ref in lpstop set stext = 1 f clkout 2 = f sys f eclk = ? f sys in lpstop set stext = 0 f clkout 2 = 0 hz f eclk = 0 hz in lpstop set stext = 1 f clkout 2 = f ref f eclk = 0 hz in lpstop set stext = 0 f clkout 2 = 0 hz f eclk = 0 hz in lpstop enter lpstop notes: 1. the simclk is used by the pit, irq , and input blocks of the sim. 2. clkout control during lpstop is overridden by the exoff bit in simcr. if exoff = 1, the clkout pin is always in a high impedance state and stext has no effect in lpstop. if exoff = 0, clkout is controlled by stext in lpstop. set up interrupt to wake up mcu from lpstop lpstopflow
motorola system integration module MC68336/376 5-14 user? manual 5.4 system protection the system protection block preserves reset status, monitors internal activity, and pro- vides periodic interrupt generation. figure 5-6 is a block diagram of the submodule. figure 5-6 system protection block 5.4.1 reset status the reset status register (rsr) latches internal mcu status during reset. refer to 5.7.10 reset status register for more information. 5.4.2 bus monitor the internal bus monitor checks data and size acknowledge (dsack ) or autovector (avec ) signal response times during normal bus cycles. the monitor asserts the in- ternal bus error (berr ) signal when the response time is excessively long. dsack and avec response times are measured in clock cycles. maximum allowable response time can be selected by setting the bus monitor timing (bmt[1:0]) field in the system protection control register (sypcr). table 5-4 shows the periods allowed. sys protect block module configuration and test reset status halt monitor bus monitor spurious interrupt monitor software watchdog timer periodic interrupt timer 2 9 prescaler clock irq[7:1] berr reset request reset request
MC68336/376 system integration module motorola user? manual 5-15 the monitor does not check dsack response on the external bus unless the cpu32 initiates a bus cycle. the bme bit in sypcr enables the internal bus monitor for inter- nal to external bus cycles. if a system contains external bus masters, an external bus monitor must be implemented and the internal-to-external bus monitor option must be disabled. when monitoring transfers to an 8-bit port, the bus monitor does not reset until both byte accesses of a word transfer are completed. monitor time-out period must be at least twice the number of clocks that a single byte access requires. 5.4.3 halt monitor the halt monitor responds to an assertion of the halt signal on the internal bus, caused by a double bus fault. a flag in the reset status register (rsr) indicates that the last reset was caused by the halt monitor. halt monitor reset can be inhibited by the halt monitor (hme) enable bit in sypcr. refer to 5.6.5.2 double bus faults for more information. 5.4.4 spurious interrupt monitor during interrupt exception processing, the cpu32 normally acknowledges an interrupt request, recognizes the highest priority source, and then either acquires a vector or responds to a request for autovectoring. the spurious interrupt monitor asserts the in- ternal bus error signal (berr ) if no interrupt arbitration occurs during interrupt exception processing. the assertion of berr causes the cpu32 to load the spurious interrupt exception vector into the program counter. the spurious interrupt monitor cannot be disabled. refer to 5.8 interrupts for more information. for detailed informa- tion about interrupt exception processing, refer to 4.9 exception processing . 5.4.5 software watchdog the software watchdog is controlled by the software watchdog enable (swe) bit in sypcr. when enabled, the watchdog requires that a service sequence be written to the software service register (swsr) on a periodic basis. if servicing does not take place, the watchdog times out and asserts the reset signal. each time the service sequence is written, the software watchdog timer restarts. the sequence to restart consists of the following steps: 1. write $55 to swsr. 2. write $aa to swsr. table 5-4 bus monitor period bmt[1:0] bus monitor time-out period 00 64 system clocks 01 32 system clocks 10 16 system clocks 11 8 system clocks
motorola system integration module MC68336/376 5-16 user? manual both writes must occur before time-out in the order listed. any number of instructions can be executed between the two writes. watchdog clock rate is affected by the software watchdog prescale (swp) bit and the software watchdog timing (swt[1:0]) field in sypcr. swp determines system clock prescaling for the watchdog timer and determines that one of two options, either no prescaling or prescaling by a factor of 512, can be select- ed. the value of swp is affected by the state of the modclk pin during reset, as shown in table 5-5 . system software can change swp value. swt[1:0] selects the divide ratio used to establish the software watchdog time-out period. the following equation calculates the time-out period for a fast reference fre- quency. the following equation calculates the time-out period for an externally input clock frequency. table 5-6 shows the divide ratio for each combination of swp and swt[1:0] bits. when swt[1:0] are modified, a watchdog service sequence must be performed be- fore the new time-out period can take effect. table 5-5 modclk pin and swp bit during reset modclk swp 0 (pll disabled) 1 ( ? 512) 1 (pll enabled) 0 ( ? 1) table 5-6 software watchdog ratio swp swt[1:0] watchdog time-out period 000 2 9 ? f sys 001 2 11 ? f sys 010 2 13 ? f sys 011 2 15 ? f sys 100 2 18 ? f sys 101 2 20 ? f sys 110 2 22 ? f sys 111 2 24 ? f sys time-out period 128 () divide ratio specified by swp and swt[1:0] () f ref -------------------------------------------------------------------------------------------------------------------------------------------- = time-out period divide ratio specified by swp and swt[1:0] f ref ------------------------------------------------------------------------------------------------------------------------ =
MC68336/376 system integration module motorola user? manual 5-17 figure 5-7 is a block diagram of the watchdog timer and the clock control for the pe- riodic interrupt timer. figure 5-7 periodic interrupt timer and software watchdog timer 5.4.6 periodic interrupt timer the periodic interrupt timer (pit) allows the generation of interrupts of specific priority at predetermined intervals. this capability is often used to schedule control system tasks that must be performed within time constraints. the timer consists of a prescaler, a modulus counter, and registers that determine interrupt timing, priority and vector as- signment. refer to 4.9 exception processing for more information. the periodic interrupt timer modulus counter is clocked by one of two signals. when the pll is enabled (modclk = 1 during reset), f ref ? 128 is used. when the pll is disabled (modclk = 0 during reset), f ref is used. the value of the periodic timer pres- caler (ptp) bit in the periodic interrupt timer register (pitr) determines system clock prescaling for the periodic interrupt timer. one of two options, either no prescaling, or prescaling by a factor of 512, can be selected. the value of ptp is affected by the state of the modclk pin during reset, as shown in table 5-7 . system software can change ptp value. table 5-7 modclk pin and ptp bit at reset modclk ptp 0 (pll disabled) 1 ( ? 512) 1 (pll enabled) 0 ( ? 1) freeze extal crystal oscillator ? 128 xtal modclk 2 9 prescaler clock select clock select and disable swp ptp ? 4 (8-bit modulus counter) pit interrupt (2 15 divider chain ?4 taps) periodic interrupt timer picr pitr software watchdog timer swsr lpstop swe swt1 swt0 software watchdog reset pit watchdog block
motorola system integration module MC68336/376 5-18 user? manual either clock signal selected by the ptp is divided by four before driving the modulus counter. the modulus counter is initialized by writing a value to the periodic interrupt timer modulus (pitm[7:0]) field in pitr. a zero value turns off the periodic timer. when the modulus counter value reaches zero, an interrupt is generated. the modulus counter is then reloaded with the value in pitm[7:0] and counting repeats. if a new value is written to pitr, it is loaded into the modulus counter when the current count is completed. when a fast reference frequency is used, the pit period can be calculated as follows: when an externally input clock frequency is used, the pit period can be calculated as follows: 5.4.7 interrupt priority and vectoring interrupt priority and vectoring are determined by the values of the periodic interrupt request level (pirql[2:0]) and periodic interrupt vector (piv) fields in the periodic in- terrupt control register (picr). the pirql field is compared to the cpu32 interrupt priority mask to determine wheth- er the interrupt is recognized. table 5-8 shows pirql[2:0] priority values. because of sim hardware prioritization, a pit interrupt is serviced before an external interrupt re- quest of the same priority. the periodic timer continues to run when the interrupt is dis- abled. the piv field contains the periodic interrupt vector. the vector is placed on the imb when an interrupt request is made. the vector number is used to calculate the address of the appropriate exception vector in the exception vector table. the reset value of the piv field is $0f, which corresponds to the uninitialized interrupt exception vector. table 5-8 periodic interrupt priority pirql[2:0] priority level 000 periodic interrupt disabled 001 interrupt priority level 1 010 interrupt priority level 2 011 interrupt priority level 3 100 interrupt priority level 4 101 interrupt priority level 5 110 interrupt priority level 6 111 interrupt priority level 7 pit period 128 () pitm[7:0] () 1 if ptp = 0, 512 if ptp = 1 () 4 () f ref ------------------------------------------------------------------------------------------------------------------------------------ - = pit period pitm[7:0] () 1 if ptp = 0, 512 if ptp = 1 () 4 () f ref --------------------------------------------------------------------------------------------------------------------- =
MC68336/376 system integration module motorola user? manual 5-19 5.4.8 low-power stop mode operation when the cpu32 executes the lpstop instruction, the current interrupt priority mask is stored in the clock control logic, internal clocks are disabled according to the state of the stsim bit in the syncr, and the mcu enters low-power stop mode. the bus monitor, halt monitor, and spurious interrupt monitor are all inactive during low-power stop mode. during low-power stop mode, the clock input to the software watchdog timer is dis- abled and the timer stops. the software watchdog begins to run again on the first rising clock edge after low-power stop mode ends. the watchdog is not reset by low-power stop mode. a service sequence must be performed to reset the timer. the periodic interrupt timer does not respond to the lpstop instruction, but continues to run during lpstop. to stop the periodic interrupt timer, pitr must be loaded with a zero value before the lpstop instruction is executed. a pit interrupt, or an external interrupt request, can bring the mcu out of low-power stop mode if it has a higher priority than the interrupt mask value stored in the clock control logic when low-power stop mode is initiated. lpstop can be terminated by a reset. 5.5 external bus interface the external bus interface (ebi) transfers information between the internal mcu bus and external devices. figure 5-8 shows a basic system with external memory and peripherals.
motorola system integration module MC68336/376 5-20 user? manual figure 5-8 mcu basic system dtack r/w cs rs[4:1] d[7:0] irq iack dsack0 dsack1 irq7 csboot cs0 cs1 cs2 cs3 cs4 r/w addr[17:0] data[15:0] v dd v dd v dd v dd v dd v dd addr[3:0] data[15:8] ce oe a[16:0] dq[15:0] addr[17:1] data[15:0] v dd e g a[14:0] dq[7:0] w addr[15:1] data[15:8] v dd v dd e g a[14:0] dq[7:0] w addr[15:1] data[7:0] v dd mc68hc681 mcm6206d MC68336/376 we 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w (async bus peripheral) (flash 64k x 16) (sram 32k x 8) mcm6206d (sram 32k x 8) 68300 sim/scim bus
MC68336/376 system integration module motorola user? manual 5-21 the external bus has 24 address lines and 16 data lines. the ebi provides dynamic sizing between 8-bit and 16-bit data accesses. it supports byte, word, and long-word transfers. port width is the maximum number of bits accepted or provided during a bus transfer. widths of eight and sixteen bits are accessed through the use of asynchro- nous cycles controlled by the size (siz1 and siz0) and data and size acknowledge (dsack1 and dsack0 ) pins. multiple bus cycles may be required for dynamically sized transfers. to add flexibility and minimize the necessity for external logic, mcu chip-select logic can be synchronized with ebi transfers. refer to 5.9 chip-selects for more informa- tion. 5.5.1 bus control signals the address bus provides addressing information to external devices. the data bus transfers 8-bit and 16-bit data between the mcu and external devices. strobe signals, one for the address bus and another for the data bus, indicate the validity of an ad- dress and provide timing information for data. control signals indicate the beginning of each bus cycle, the address space it is to take place in, the size of the transfer, and the type of cycle. external devices decode these signals and respond to transfer data and terminate the bus cycle. the ebi operates in an asynchronous mode for any port width. 5.5.1.1 address bus bus signals addr[23:0] define the address of the byte (or the most significant byte) to be transferred during a bus cycle. the mcu places the address on the bus at the beginning of a bus cycle. the address is valid while as is asserted. 5.5.1.2 address strobe address strobe (as ) is a timing signal that indicates the validity of an address on the address bus and of many control signals. it is asserted one-half clock after the begin- ning of a bus cycle. 5.5.1.3 data bus signals data[15:0] form a bidirectional, non-multiplexed parallel bus that transfers data to or from the mcu. a read or write operation can transfer eight or sixteen bits of data in one bus cycle. during a read cycle, the data is latched by the mcu on the last falling edge of the clock for that bus cycle. for a write cycle, all 16 bits of the data bus are driven, regardless of the port width or operand size. the mcu places the data on the data bus one-half clock cycle after as is asserted in a write cycle.
motorola system integration module MC68336/376 5-22 user? manual 5.5.1.4 data strobe data strobe (ds ) is a timing signal. for a read cycle, the mcu asserts ds to signal an external device to place data on the bus. ds is asserted at the same time as as during a read cycle. for a write cycle, ds signals an external device that data on the bus is valid. the mcu asserts ds one full clock cycle after the assertion of as during a write cycle. 5.5.1.5 read/write signal the read/write signal (r/w ) determines the direction of the transfer during a bus cycle. this signal changes state, when required, at the beginning of a bus cycle, and is valid while as is asserted. r/w only transitions when a write cycle is preceded by a read cycle or vice versa. the signal may remain low for two consecutive write cycles. 5.5.1.6 size signals size signals (siz[1:0]) indicate the number of bytes remaining to be transferred during an operand cycle. they are valid while the as is asserted. table 5-9 shows siz0 and siz1 encoding. 5.5.1.7 function codes the cpu generates function code signals (fc[2:0]) to indicate the type of activity oc- curring on the data or address bus. these signals can be considered address exten- sions that can be externally decoded to determine which of eight external address spaces is accessed during a bus cycle. address space 7 is designated cpu space. cpu space is used for control information not normally associated with read or write bus cycles. function codes are valid while as is asserted. table 5-10 shows address space encoding. table 5-9 size signal encoding siz1 siz0 transfer size 0 1 byte 1 0 word 1 1 three bytes 0 0 long word
MC68336/376 system integration module motorola user? manual 5-23 the supervisor bit in the status register determines whether the cpu is operating in supervisor or user mode. addressing mode and the instruction being executed deter- mine whether a memory access is to program or data space. 5.5.1.8 data and size acknowledge signals during normal bus transfers, external devices assert the data and size acknowledge signals (dsack[1:0] ) to indicate port width to the mcu. during a read cycle, these sig- nals tell the mcu to terminate the bus cycle and to latch data. during a write cycle, the signals indicate that an external device has successfully stored data and that the cycle can terminate. dsack[1:0] can also be supplied internally by chip-select logic. refer to 5.9 chip-selects for more information. 5.5.1.9 bus error signal the bus error signal (berr ) is asserted when a bus cycle is not properly terminated by dsack or avec assertion. it can also be asserted in conjunction with dsack to indicate a bus error condition, provided it meets the appropriate timing requirements. refer to 5.6.5 bus exception control cycles for more information. the internal bus monitor can generate the berr signal for internal-to-internal and internal-to-external transfers. in systems with an external bus master, the sim bus monitor must be disabled and external logic must be provided to drive the berr pin, because the internal berr monitor has no information about transfers initiated by an external bus master. refer to 5.6.6 external bus arbitration for more information. 5.5.1.10 halt signal the halt signal (halt ) can be asserted by an external device for debugging purposes to cause single bus cycle operation or (in combination with berr ) a retry of a bus cy- cle in error. the halt signal affects external bus cycles only. as a result, a program not requiring use of the external bus may continue executing, unaffected by the halt signal. table 5-10 address space encoding fc2 fc1 fc0 address space 0 0 0 reserved 0 0 1 user data space 0 1 0 user program space 0 1 1 reserved 1 0 0 reserved 1 0 1 supervisor data space 1 1 0 supervisor program space 1 1 1 cpu space
motorola system integration module MC68336/376 5-24 user? manual when the mcu completes a bus cycle with the halt signal asserted, data[15:0] is placed in a high-impedance state and bus control signals are driven inactive; the ad- dress, function code, size, and read/write signals remain in the same state. if halt is still asserted once bus mastership is returned to the mcu, the address, function code, size, and read/write signals are again driven to their previous states. the mcu does not service interrupt requests while it is halted. refer to 5.6.5 bus exception control cycles for more information. 5.5.1.11 autovector signal the autovector signal (avec ) can be used to terminate external interrupt acknowl- edge cycles. assertion of avec causes the cpu32 to generate vector numbers to lo- cate an interrupt handler routine. if avec is continuously asserted, autovectors are generated for all external interrupt requests. avec is ignored during all other bus cy- cles. refer to 5.8 interrupts for more information. avec for external interrupt re- quests can also be supplied internally by chip-select logic. refer to 5.9 chip-selects for more information. the autovector function is disabled when there is an external bus master. refer to 5.6.6 external bus arbitration for more information. 5.5.2 dynamic bus sizing the mcu dynamically interprets the port size of an addressed device during each bus cycle, allowing operand transfers to or from 8-bit and 16-bit ports. during an operand transfer cycle, an external device signals its port size and indicates completion of the bus cycle to the mcu through the use of the dsack inputs, as shown in table 5-11 . chip-select logic can generate data and size acknowledge sig- nals for an external device. refer to 5.9 chip-selects for more information. if the cpu is executing an instruction that reads a long-word operand from a 16-bit port, the mcu latches the 16 bits of valid data and then runs another bus cycle to ob- tain the other 16 bits. the operation for an 8-bit port is similar, but requires four read cycles. the addressed device uses the dsack signals to indicate the port width. for instance, a 16-bit device always returns dsack for a 16-bit port (regardless of wheth- er the bus cycle is a byte or word operation). dynamic bus sizing requires that the portion of the data bus used for a transfer to or from a particular port size be fixed. a 16-bit port must reside on data bus bits [15:0], and an 8-bit port must reside on data bus bits [15:8]. this minimizes the number of bus cycles needed to transfer data and ensures that the mcu transfers valid data. table 5-11 effect of dsack signals dsack1 dsack0 result 1 1 insert wait states in current bus cycle 1 0 complete cycle ?data bus port size is 8 bits 0 1 complete cycle ?data bus port size is 16 bits 0 0 reserved
MC68336/376 system integration module motorola user? manual 5-25 the mcu always attempts to transfer the maximum amount of data on all bus cycles. for any bus access, it is assumed that the port is 16 bits wide when the bus cycle begins. operand bytes are designated as shown in figure 5-9 . op[0:3] represent the order of access. for instance, op0 is the most significant byte of a long-word operand, and is accessed first, while op3, the least significant byte, is accessed last. the two bytes of a word-length operand are op0 (most significant) and op1. the single byte of a byte- length operand is op0. figure 5-9 operand byte order 5.5.3 operand alignment the ebi data multiplexer establishes the necessary connections for different combi- nations of address and data sizes. the multiplexer takes the two bytes of the 16-bit bus and routes them to their required positions. positioning of bytes is determined by the size and address outputs. siz1 and siz0 indicate the number of bytes remaining to be transferred during the current bus cycle. the number of bytes transferred is equal to or less than the size indicated by siz1 and siz0, depending on port width. addr0 also affects the operation of the data multiplexer. during an operand transfer, addr[23:1] indicate the word base address of the portion of the operand to be ac- cessed. addr0 indicates the byte offset from the base. 5.5.4 misaligned operands the cpu32 uses a basic operand size of 16 bits. an operand is misaligned when it overlaps a word boundary. this is determined by the value of addr0. when addr0 = 0 (an even address), the address is on a word and byte boundary. when addr0 = 1 (an odd address), the address is on a byte boundary only. a byte operand is aligned at any address; a word or long-word operand is misaligned at an odd address. the cpu32 does not support misaligned transfers. the largest amount of data that can be transferred by a single bus cycle is an aligned word. if the mcu transfers a long-word operand through a 16-bit port, the most signif- icant operand word is transferred on the first bus cycle and the least significant oper- and word is transferred on a following bus cycle. op0 operand byte order op1 op2 op3 24 31 23 16 15 8 7 0 byte order operand long word three byte word byte op2 op1 op0 op1 op0 op0
motorola system integration module MC68336/376 5-26 user? manual 5.5.5 operand transfer cases table 5-12 is a summary of how operands are aligned for various types of transfers. opn entries are portions of a requested operand that are read or written during a bus cycle and are defined by siz1, siz0, and addr0 for that bus cycle. the following paragraphs discuss all the allowable transfer cases in detail. 5.6 bus operation internal microcontroller modules are typically accessed in two system clock cycles. regular external bus cycles use handshaking between the mcu and external periph- erals to manage transfer size and data. these accesses take three system clock cy- cles, with no wait states. during regular cycles, wait states can be inserted as needed by bus control logic. refer to 5.6.2 regular bus cycles for more information. fast termination cycles, which are two-cycle external accesses with no wait states, use chip-select logic to generate handshaking signals internally. chip-select logic can also be used to insert wait states before internal generation of handshaking signals. refer to 5.6.3 fast termination cycles and 5.9 chip-selects for more information. bus control signal timing, as well as chip-select signal timing, are specified in appen- dix a electrical characteristics . refer to the sim reference manual (sim- rm/ad) for more information about each type of bus cycle. 5.6.1 synchronization to clkout external devices connected to the mcu bus can operate at a clock frequency different from the frequencies of the mcu as long as the external devices satisfy the interface signal timing constraints. although bus cycles are classified as asynchronous, they are interpreted relative to the mcu system clock output (clkout). descriptions are made in terms of individual system clock states, labeled {s0, s1, s2,..., s n }. the designation ?tate?refers to the logic level of the clock signal and does not correspond to any implemented machine state. a clock cycle consists of two suc- cessive states. refer to table a-4 for more information. notes: 1. all transfers are aligned. the cpu32 does not support misaligned word or long-word transfers. 2. operands in parentheses are ignored by the cpu32 during read cycles. 3. three-byte transfer cases occur only as a result of a long word to 8-bit port transfer. table 5-12 operand alignment current cycle transfer case 1 siz1 siz0 addr0 dsack1 dsack0 data [15:8] data [7:0] next cycle 1 byte to 8-bit port (even) 0 1 0 1 0 op0 (op0) 2 2 byte to 8-bit port (odd) 0 1 1 1 0 op0 (op0) 3 byte to 16-bit port (even) 0 1 0 0 1 op0 (op0) 4 byte to 16-bit port (odd) 0 1 1 0 1 (op0) op0 5 word to 8-bit port 1 0 0 1 0 op0 (op1) 2 6 word to 16-bit port 1 0 0 0 1 op0 op1 7 3-byte to 8-bit port 3 1 1 1 1 0 op0 (op0) 5 8 long word to 8-bit port 0 0 0 1 0 op0 (op0) 7 9 long word to 16-bit port 0 0 0 0 1 op0 op1 6
MC68336/376 system integration module motorola user? manual 5-27 bus cycles terminated by dsack assertion normally require a minimum of three clk- out cycles. to support systems that use clkout to generate dsack and other in- puts, asynchronous input setup time and asynchronous input hold times are specified. when these specifications are met, the mcu is guaranteed to recognize the appropri- ate signal on a specific edge of the clkout signal. for a read cycle, when assertion of dsack is recognized on a particular falling edge of the clock, valid data is latched into the mcu on the next falling clock edge, provided that the data meets the data setup time. in this case, the parameter for asynchronous operation can be ignored. when a system asserts dsack for the required window around the falling edge of s2 and obeys the bus protocol by maintaining dsack and berr or halt until and throughout the clock edge that negates as (with the appropriate asynchronous input hold time), no wait states are inserted. the bus cycle runs at the maximum speed of three clocks per cycle. to ensure proper operation in a system synchronized to clkout, when either berr or berr and halt is asserted after dsack , berr (or berr and halt ) assertion must satisfy the appropriate data-in setup and hold times before the falling edge of the clock cycle after dsack is recognized. 5.6.2 regular bus cycles the following paragraphs contain a discussion of cycles that use external bus control logic. refer to 5.6.3 fast termination cycles for information about fast termination cycles. to initiate a transfer, the mcu asserts an address and the siz[1:0] signals. the siz signals and addr0 are externally decoded to select the active portion of the data bus. refer to 5.5.2 dynamic bus sizing . when as , ds , and r/w are valid, a peripheral device either places data on the bus (read cycle) or latches data from the bus (write cycle), then asserts a dsack[1:0] combination that indicates port size. the dsack[1:0] signals can be asserted before the data from a peripheral device is valid on a read cycle. to ensure valid data is latched into the mcu, a maximum period between dsack assertion and ds assertion is specified. there is no specified maximum for the period between the assertion of as and dsack . although the mcu can transfer data in a minimum of three clock cycles when the cycle is terminated with dsack , the mcu inserts wait cycles in clock period incre- ments until either dsack signal goes low.
motorola system integration module MC68336/376 5-28 user? manual if bus termination signals remain unasserted, the mcu will continue to insert wait states, and the bus cycle will never end. if no peripheral responds to an access, or if an access is invalid, external logic should assert the berr or halt signals to abort the bus cycle (when berr and halt are asserted simultaneously, the cpu32 acts as though only berr is asserted). when enabled, the sim bus monitor asserts berr when dsack response time exceeds a predetermined limit. the bus monitor timeout period is determined by the bmt[1:0] field in sypcr. the maximum bus monitor tim- eout period is 64 system clock cycles. 5.6.2.1 read cycle during a read cycle, the mcu transfers data from an external memory or peripheral device. if the instruction specifies a long-word or word operation, the mcu attempts to read two bytes at once. for a byte operation, the mcu reads one byte. the portion of the data bus from which each byte is read depends on operand size, peripheral ad- dress, and peripheral port size. figure 5-10 is a flowchart of a word read cycle. refer to 5.5.2 dynamic bus sizing , 5.5.4 misaligned operands , and the sim reference manual (simrm/ad) for more information. figure 5-10 word read cycle flowchart rd cyc flow mcu peripheral address device (s0) 1) set r/w to read 2) drive address on addr[23:0] 3) drive function code on fc[2:0] 4) drive siz[1:0] for operand size start next cycle (s0) 1) decode addr, r/w , siz[1:0], ds 2) place data on data[15:0] or data[15:8] if 8-bit data present data (s2) 3) drive dsack signals terminate cycle (s5) 1) remove data from data bus 2) negate dsack assert as and ds (s1) decode dsack (s3) latch data (s4) negate as and ds (s5)
MC68336/376 system integration module motorola user? manual 5-29 5.6.2.2 write cycle during a write cycle, the mcu transfers data to an external memory or peripheral de- vice. if the instruction specifies a long-word or word operation, the mcu attempts to write two bytes at once. for a byte operation, the mcu writes one byte. the portion of the data bus upon which each byte is written depends on operand size, peripheral ad- dress, and peripheral port size. refer to 5.5.2 dynamic bus sizing and 5.5.4 misaligned operands for more infor- mation. figure 5-11 is a flowchart of a write-cycle operation for a word transfer. refer to the sim reference manual (simrm/ad) for more information. figure 5-11 write cycle flowchart wr cyc flow mcu peripheral address device (s0) 1) decode address 2) latch data from data bus accept data (s2 + s3) 3) assert dsack signals terminate cycle negate dsack 1) set r/w to write 2) drive address on addr[23:0] 3) drive function code on fc[2:0] 4) drive siz[1:0] for operand size 1) negate ds and as 2) remove data from data bus terminate output transfer (s5) start next cycle assert as (s1) place data on data[15:0] (s2) assert ds and wait for dsack (s3) optional state (s4) no change
motorola system integration module MC68336/376 5-30 user? manual 5.6.3 fast termination cycles when an external device has a fast access time, the chip-select circuit fast termination option can provide a two-cycle external bus transfer. because the chip-select circuits are driven from the system clock, the bus cycle termination is inherently synchronized with the system clock. if multiple chip-selects are to be used to provide control signals to a single device and match conditions occur simultaneously, all mode, strb, and associated dsack fields must be programmed to the same value. this prevents a conflict on the internal bus when the wait states are loaded into the dsack counter shared by all chip- selects. fast termination cycles use internal handshaking signals generated by the chip-select logic. to initiate a transfer, the mcu asserts an address and the siz[1:0] signals. when as , ds , and r/w are valid, a peripheral device either places data on the bus (read cycle) or latches data from the bus (write cycle). at the appropriate time, chip- select logic asserts data and size acknowledge signals. the dsack option fields in the chip-select option registers determine whether inter- nally generated dsack or externally generated dsack is used. the external dsack lines are always active, regardless of the setting of the dsack field in the chip-select option registers. thus, an external dsack can always terminate a bus cycle. holding a dsack line low will cause all external bus cycles to be three-cycle (zero wait states) accesses unless the chip-select option register specifies fast accesses. for fast termination cycles, the fast termination encoding (%1110) must be used. re- fer to 5.9.1 chip-select registers for information about fast termination setup. to use fast termination, an external device must be fast enough to have data ready within the specified setup time (for example, by the falling edge of s4). refer to table a-6 and figures a-6 and a-7 for information about fast termination timing. when fast termination is in use, ds is asserted during read cycles but not during write cycles. the strb field in the chip-select option register used must be programmed with the address strobe encoding to assert the chip-select signal for a fast termination write. 5.6.4 cpu space cycles function code signals fc[2:0] designate which of eight external address spaces is ac- cessed during a bus cycle. address space 7 is designated cpu space. cpu space is used for control information not normally associated with read or write bus cycles. function codes are valid only while as is asserted. refer to 5.5.1.7 function codes for more information on codes and encoding. during a cpu space access, addr[19:16] are encoded to reflect the type of access being made. figure 5-12 shows the three encodings used by 68300 family microcon- trollers. these encodings represent breakpoint acknowledge (type $0) cycles, low power stop broadcast (type $3) cycles, and interrupt acknowledge (type $f) cycles. refer to 5.8 interrupts for information about interrupt acknowledge bus cycles.
MC68336/376 system integration module motorola user? manual 5-31 figure 5-12 cpu space address encoding 5.6.4.1 breakpoint acknowledge cycle breakpoints stop program execution at a predefined point during system development. breakpoints can be used alone or in conjunction with background debug mode. in m68300 microcontrollers, both hardware and software can initiate breakpoints. the cpu32 bkpt instruction allows the user to insert breakpoints through software. the cpu responds to this instruction by initiating a breakpoint acknowledge read cycle in cpu space. it places the breakpoint acknowledge (%0000) code on addr[19:16], the breakpoint number (bits [2:0] of the bkpt opcode) on addr[4:2], and %0 (indi- cating a software breakpoint) on addr1. external breakpoint circuitry decodes the function code and address lines and re- sponds by either asserting berr or placing an instruction word on the data bus and asserting dsack . if the bus cycle is terminated by dsack , the cpu32 reads the in- struction on the data bus and inserts the instruction into the pipeline. (for 8-bit ports, this instruction fetch may require two read cycles.) if the bus cycle is terminated by berr , the cpu32 then performs illegal instruction exception processing: it acquires the number of the illegal instruction exception vector, computes the vector address from this number, loads the content of the vector address into the pc, and jumps to the exception handler routine at that address. assertion of the bkpt input initiates a hardware breakpoint. the cpu32 responds by initiating a breakpoint acknowledge read cycle in cpu space. it places the breakpoint acknowledge code of %0000 on addr[19:16], the breakpoint number value of %111 on addr[4:2], and addr1 is set to %1, indicating a hardware breakpoint. cpu space cyc tim 0000000000000000000 t0 bkpt# 19 23 16 000000111111111111111110 19 16 23 111 111 11111111111111111111 1 111 level 19 16 23 cpu space cycles function code 20 20 20 0 0 0 cpu space type field address bus breakpoint acknowledge low power stop broadcast interrupt acknowledge 2 41
motorola system integration module MC68336/376 5-32 user? manual external breakpoint circuitry decodes the function code and address lines, places an instruction word on the data bus, and asserts berr . the cpu32 then performs hard- ware breakpoint exception processing: it acquires the number of the hardware break- point exception vector, computes the vector address from this number, loads the content of the vector address into the pc, and jumps to the exception handler routine at that address. if the external device asserts dsack rather than berr , the cpu32 ignores the breakpoint and continues processing. when bkpt assertion is synchronized with an instruction prefetch, processing of the breakpoint exception occurs at the end of that instruction. the prefetched instruction is ?agged?with the breakpoint when it enters the instruction pipeline. the breakpoint exception occurs after the instruction executes. if the pipeline is flushed before the tagged instruction is executed, no breakpoint occurs. when bkpt assertion is syn- chronized with an operand fetch, exception processing occurs at the end of the instruc- tion during which bkpt is latched. refer to the cpu32 reference manual (cpu32rm/ad) and the sim reference man- ual (simrm/ad) for additional information. breakpoint operation flow for the cpu32 is shown in figure 5-13 .
MC68336/376 system integration module motorola user? manual 5-33 figure 5-13 breakpoint operation flowchart if breakpoint instruction executed: 1) set r/w to read 2) set function code to cpu space 3) place cpu space type 0 on addr[19:16] 4) place breakpoint number on addr[4:2] 5) clear t-bit (addr1) to zero 6) set size to word 7) assert as and ds if bkpt pin asserted: 1) set r/w to read 2) set function code to cpu space 3) place cpu space type 0 on addr[19:16] 4) place all ones on addr[4:2] 5) set t-bit (addr1) to one 6) set size to word 7) assert as and ds acknowledge breakpoint if breakpoint instruction executed and dsack is asserted: 1) latch data 2) negate as and ds 3) go to (a) if bkpt pin asserted and dsack is asserted: 1) negate as and ds 2) go to (a) if berr asserted: 1) negate as and ds 2) go to (b) (a) (b) 1) assert berr to initiate exception processing if bkpt instruction executed: 1) place latched data in instruction pipeline 2) continue processing if bkpt pin asserted: 1) continue processing if bkpt instruction executed: 1) initiate illegal instruction processing if bkpt pin asserted: 1) initiate hardware breakpoint processing 1) negate dsack or berr breakpoint operation flow cpu32 peripheral if bkpt asserted: 1) assert dsack or: 1) assert berr to initiate exception processing if bkpt instruction executed: 1) place replacement opcode on data bus 2) assert dsack or: breakpoint operation flow
motorola system integration module MC68336/376 5-34 user? manual 5.6.4.2 lpstop broadcast cycle low-power stop mode is initiated by the cpu32. individual modules can be stopped by setting the stop bits in each module configuration register, or the sim can turn off system clocks after execution of the lpstop instruction. when the cpu32 executes lpstop, an lpstop broadcast cycle is generated. the sim brings the mcu out of low-power stop mode when either an interrupt of higher priority than the stored mask or a reset occurs. refer to 5.3.4 low-power operation and 4.8.2.1 low-power stop (lpstop) for more information. during an lpstop broadcast cycle, the cpu32 performs a cpu space write to ad- dress $3fffe. this write puts a copy of the interrupt mask value in the clock control logic. the mask is encoded on the data bus as shown in figure 5-14 . the lpstop cpu space cycle is shown externally (if the bus is available) as an indication to exter- nal devices that the mcu is going into low-power stop mode. the sim provides an in- ternally generated dsack response to this cycle. the timing of this bus cycle is the same as for a fast termination write cycle. if the bus is not available (arbitrated away), the lpstop broadcast cycle is not shown externally. note berr during the lpstop broadcast cycle is ignored. figure 5-14 lpstop interrupt mask level 5.6.5 bus exception control cycles an external device or a chip-select circuit must assert at least one of the dsack[1:0] signals or the avec signal to terminate a bus cycle normally. bus error processing oc- curs when bus cycles are not terminated in the expected manner. the sim bus monitor can be used to generate berr internally, causing a bus error exception to be taken. bus cycles can also be terminated by assertion of the external berr or halt pins signal, or by assertion of the two signals simultaneously. acceptable bus cycle termination sequences are summarized as follows. the case numbers refer to table 5-13 , which indicates the results of each type of bus cycle ter- mination. ?normal termination ?dsack is asserted; berr and halt remain negated (case 1). ?halt termination ?halt is asserted at the same time or before dsack , and berr remains negated (case 2). lpstop mask level 15 8 7 0 ip mask 14 13 12 11 10 9 6 5 4 3 2 1 0000000000000
MC68336/376 system integration module motorola user? manual 5-35 ?bus error termination ?berr is asserted in lieu of, at the same time as, or before dsack (case 3), or after dsack (case 4), and halt remains negated; berr is negated at the same time or after dsack . ?retry termination ?halt and berr are asserted in lieu of, at the same time as, or before dsack (case 5) or after dsack (case 6); berr is negated at the same time or after dsack ; halt may be negated at the same time or after berr . table 5-13 shows various combinations of control signal sequences and the resulting bus cycle terminations. to control termination of a bus cycle for a retry or a bus error condition properly, dsack , berr , and halt must be asserted and negated with the rising edge of the mcu clock. this ensures that when two signals are asserted simultaneously, the required setup time and hold time for both of them are met for the same falling edge of the mcu clock. refer to appendix a electrical characteristics for timing requirements. external circuitry that provides these signals must be designed with these constraints in mind, or else the internal bus monitor must be used. dsack , berr , and halt may be negated after as is negated. notes: 1. n = the number of current even bus state (s2, s4, etc.). 2. a = signal is asserted in this bus state. 3. na = signal is not asserted in this state. 4. x = don? care. 5. s = signal was asserted in previous state and remains asserted in this state. table 5-13 dsack , berr , and halt assertion results case number control signal asserted on rising edge of state result n 1 n + 2 1 dsack berr halt a 2 na 3 na s 4 na x 5 normal termination. 2 dsack berr halt a na a/s s na s halt termination: normal cycle terminate and halt. continue when halt is negated. 3 dsack berr halt na/a a na x s x bus error termination: terminate and take bus error exception, possibly deferred. 4 dsack berr halt a a na x s na bus error termination: terminate and take bus error exception, possibly deferred. 5 dsack berr halt na/a a a/s x s s retry termination: terminate and retry when halt is negated. 6 dsack berr halt a na na x a a retry termination: terminate and retry when halt is negated.
motorola system integration module MC68336/376 5-36 user? manual warning if dsack or berr remain asserted into s2 of the next bus cycle, that cycle may be terminated prematurely. 5.6.5.1 bus errors the cpu32 treats bus errors as a type of exception. bus error exception processing begins when the cpu32 detects assertion of the imb berr signal (by the internal bus monitor or an external source) while the halt signal remains negated. berr assertions do not force immediate exception processing. the signal is synchro- nized with normal bus cycles and is latched into the cpu32 at the end of the bus cycle in which it was asserted. because bus cycles can overlap instruction boundaries, bus error exception processing may not occur at the end of the instruction in which the bus cycle begins. timing of berr detection/acknowledge is dependent upon several fac- tors: ?which bus cycle of an instruction is terminated by assertion of berr . ?the number of bus cycles in the instruction during which berr is asserted. ?the number of bus cycles in the instruction following the instruction in which berr is asserted. ?whether berr is asserted during a program space access or a data space ac- cess. because of these factors, it is impossible to predict precisely how long after occur- rence of a bus error the bus error exception is processed. caution the external bus interface does not latch data when an external bus cycle is terminated by a bus error. when this occurs during an in- struction prefetch, the imb precharge state (bus pulled high, or $ff) is latched into the cpu32 instruction register, with indeterminate re- sults. 5.6.5.2 double bus faults exception processing for bus error exceptions follows the standard exception process- ing sequence. refer to 4.9 exception processing for more information. however, a special case of bus error, called double bus fault, can abort exception processing. berr assertion is not detected until an instruction is complete. the berr latch is cleared by the first instruction of the berr exception handler. double bus fault occurs in three ways: 1. when bus error exception processing begins and a second berr is detected before the first instruction of the exception handler is executed. 2. when one or more bus errors occur before the first instruction after a reset ex- ception is executed. 3. a bus error occurs while the cpu32 is loading information from a bus error stack frame during a return from exception (rte) instruction.
MC68336/376 system integration module motorola user? manual 5-37 multiple bus errors within a single instruction that can generate multiple bus cycles cause a single bus error exception after the instruction has been executed. immediately after assertion of a second berr , the mcu halts and drives the halt line low. only a reset can restart a halted mcu. however, bus arbitration can still oc- cur. refer to 5.6.6 external bus arbitration for more information. a bus error or ad- dress error that occurs after exception processing has been completed (during the execution of the exception handler routine, or later) does not cause a double bus fault. the mcu continues to retry the same bus cycle as long as the external hardware re- quests it. 5.6.5.3 retry operation when an external device asserts berr and halt during a bus cycle, the mcu enters the retry sequence. a delayed retry can also occur. the mcu terminates the bus cycle, places the as and ds signals in their inactive state, and does not begin another bus cycle until the berr and halt signals are negated by external logic. after a synchro- nization delay, the mcu retries the previous cycle using the same address, function codes, data (for a write), and control signals. the berr signal should be negated be- fore s2 of the read cycle to ensure correct operation of the retried cycle. if br , berr , and halt are all asserted on the same cycle, the ebi will enter the rerun sequence but first relinquishes the bus to an external master. once the external mas- ter returns the bus and negates berr and halt , the ebi runs the previous bus cycle. this feature allows an external device to correct the problem that caused the bus error and then try the bus cycle again. the mcu retries any read or write cycle of an indivisible read-modify-write operation separately. rmc remains asserted during the entire retry sequence. the mcu will not relinquish the bus while rmc is asserted. any device that requires the mcu to give up the bus and retry a bus cycle during a read-modify-write cycle must assert berr and br only (halt must remain negated). the bus error handler software should examine the read-modify-write bit in the special status word and take the appropriate action to resolve this type of fault when it occurs. refer to the sim reference manual (simrm/ ad) for additional information on read-modify-write and retry operations. 5.6.5.4 halt operation when halt is asserted while berr is not asserted, the mcu halts external bus ac- tivity after negation of dsack . the mcu may complete the current word transfer in progress. for a long-word to byte transfer, this could be after s2 or s4. for a word to byte transfer, activity ceases after s2. negating and reasserting halt according to timing requirements provides single-step (bus cycle to bus cycle) operation. the halt signal affects external bus cycles only, so that a program that does not use the external bus can continue executing. during dynamically-sized 8-bit transfers, external bus activity may not stop at the next cycle boundary. occurrence of a bus error while halt is asserted causes the cpu32 to initiate a retry sequence.
motorola system integration module MC68336/376 5-38 user? manual when the mcu completes a bus cycle while the halt signal is asserted, the data bus goes into a high-impedance state and the as and ds signals are driven to their inac- tive states. address, function code, size, and read/write signals remain in the same state. the halt operation has no effect on bus arbitration. however, when external bus arbi- tration occurs while the mcu is halted, address and control signals go into a high- impedance state. if halt is still asserted when the mcu regains control of the bus, address, function code, size, and read/write signals revert to the previous driven states. the mcu cannot service interrupt requests while halted. 5.6.6 external bus arbitration the mcu bus design provides for a single bus master at any one time. either the mcu or an external device can be master. bus arbitration protocols determine when an ex- ternal device can become bus master. bus arbitration requests are recognized during normal processing, halt assertion, and when the cpu32 has halted due to a double bus fault. the bus controller in the mcu manages bus arbitration signals so that the mcu has the lowest priority. external devices that need to obtain the bus must assert bus arbi- tration signals in the sequences described in the following paragraphs. systems that include several devices that can become bus master require external cir- cuitry to assign priorities to the devices, so that when two or more external devices at- tempt to become bus master at the same time, the one having the highest priority becomes bus master first. the protocol sequence is: 1. an external device asserts the bus request signal (br ); 2. the mcu asserts the bus grant signal (bg ) to indicate that the bus is available; 3. an external device asserts the bus grant acknowledge (bgack ) signal to indi- cate that it has assumed bus mastership. br can be asserted during a bus cycle or between cycles. bg is asserted in response to br . to guarantee operand coherency, bg is only asserted at the end of operand transfer. additionally, bg is not asserted until the end of an indivisible read-modify- write operation (when rmc is negated). if more than one external device can be bus master, required external arbitration must begin when a requesting device receives bg . an external device must assert bgack when it assumes mastership, and must maintain bgack assertion as long as it is bus master. two conditions must be met for an external device to assume bus mastership. the de- vice must receive bg through the arbitration process, and bgack must be inactive, indicating that no other bus master is active. this technique allows the processing of bus requests during data transfer cycles. bg is negated a few clock cycles after bgack transition. however, if bus requests are still pending after bg is negated, the mcu asserts bg again within a few clock cycles.
MC68336/376 system integration module motorola user? manual 5-39 this additional bg assertion allows external arbitration circuitry to select the next bus master before the current master has released the bus. refer to figure 5-15 , which shows bus arbitration for a single device. the flowchart shows br negated at the same time bgack is asserted. figure 5-15 bus arbitration flowchart for single request 5.6.6.1 show cycles the mcu normally performs internal data transfers without affecting the external bus, but it is possible to show these transfers during debugging. as is not asserted exter- nally during show cycles. show cycles are controlled by shen[1:0] in simcr. this field is set to %00 by reset. when show cycles are disabled, the address bus, function codes, size, and read/write signals reflect internal bus activity, but as and ds are not asserted externally and ex- ternal data bus pins are in high-impedance state during internal accesses. refer to 5.2.3 show internal cycles and the sim reference manual (simrm/ad) for more in- formation. when show cycles are enabled, ds is asserted externally during internal cycles, and internal data is driven out on the external data bus. because internal cycles normally continue to run when the external bus is granted, one shen encoding halts internal bus activity while there is an external master. grant bus arbitration 1) assert bus grant (bg ) terminate arbitration 1) negate bg (and wait for bgack to be negated) re-arbitrate or resume processor operation mcu requesting device request the bus 1) assert bus request (br ) acknowledge bus mastership 1) external arbitration determines next bus master 2) next bus master waits for bgack to be negated 3) next bus master asserts bgack to become new master 4) bus master negates br operate as bus master 1) perform data transfers (read and write cycles) according to the same rules the processor uses release bus mastership 1) negate bgack bus arb flow
motorola system integration module MC68336/376 5-40 user? manual siz[1:0] signals reflect bus allocation during show cycles. only the appropriate portion of the data bus is valid during the cycle. during a byte write to an internal address, the portion of the bus that represents the byte that is not written reflects internal bus con- ditions, and is indeterminate. during a byte write to an external address, the data mul- tiplexer in the sim causes the value of the byte that is written to be driven out on both bytes of the data bus. 5.7 reset reset occurs when an active low logic level on the reset pin is clocked into the sim. the reset input is synchronized to the system clock. if there is no clock when re set is asserted, reset does not occur until the clock starts. resets are clocked to allow completion of write cycles in progress at the time reset is asserted. reset procedures handle system initialization and recovery from catastrophic failure. the mcu performs resets with a combination of hardware and software. the sim determines whether a reset is valid, asserts control signals, performs basic system configuration and boot rom selection based on hardware mode-select inputs, then passes control to the cpu32. 5.7.1 reset exception processing the cpu32 processes resets as a type of asynchronous exception. an exception is an event that preempts normal processing, and can be caused by internal or external events. exception processing makes the transition from normal instruction execution to execution of a routine that deals with an exception. each exception has an assigned vector that points to an associated handler routine. these vectors are stored in the exception vector table. the exception vector table consists of 256 four-byte vectors and occupies 1024 bytes of address space. the exception vector table can be relocat- ed in memory by changing its base address in the vector base register (vbr). the cpu32 uses vector numbers to calculate displacement into the table. refer to 4.9 ex- ception processing for more information. reset is the highest-priority cpu32 exception. unlike all other exceptions, a reset oc- curs at the end of a bus cycle, and not at an instruction boundary. handling resets in this way prevents write cycles in progress at the time the reset signal is asserted from being corrupted. however, any processing in progress is aborted by the reset excep- tion and cannot be restarted. only essential reset tasks are performed during excep- tion processing. other initialization tasks must be accomplished by the exception handler routine. refer to 5.7.9 reset processing summary for details on exception processing. 5.7.2 reset control logic sim reset control logic determines the cause of a reset, synchronizes reset assertion if necessary to the completion of the current bus cycle, and asserts the appropriate re- set lines. reset control logic can drive four different internal signals:
MC68336/376 system integration module motorola user? manual 5-41 1. xtrst (external reset) drives the external reset pin. 2. clkrst (clock reset) resets the clock module. 3. mstrst (master reset) goes to all other internal circuits. 4. sysrst (system reset) indicates to internal circuits that the cpu32 has executed a reset instruction. all resets are gated by clkout. resets are classified as synchronous or asynchro- nous. an asynchronous reset can occur on any clkout edge. reset sources that cause an asynchronous reset usually indicate a catastrophic failure. as a result, the reset control logic responds by asserting reset to the system immediately. (a system reset, however, caused by the cpu32 reset instruction, is asynchronous but does not indicate any type of catastrophic failure). synchronous resets are timed to occur at the end of bus cycles. the sim bus monitor is automatically enabled for synchronous resets. when a bus cycle does not terminate normally, the bus monitor terminates it. refer to table 5-14 for a summary of reset sources. internal single byte or aligned word writes are guaranteed valid for synchronous resets. external writes are also guaranteed to complete, provided the external config- uration logic on the data bus is conditioned as shown in figure 5-16 . 5.7.3 reset mode selection the logic states of certain data bus pins during reset determine sim operating config- uration. in addition, the state of the modclk pin determines system clock source and the state of the bkpt pin determines what happens during subsequent breakpoint as- sertions. table 5-15 is a summary of reset mode selection options. table 5-14 reset source summary type source timing cause reset lines asserted by controller external external synch reset pin mstrst clkrst extrst power up ebi asynch v dd mstrst clkrst extrst software watchdog monitor asynch time out mstrst clkrst extrst halt monitor asynch internal halt assertion (e.g. double bus fault) mstrst clkrst extrst loss of clock clock synch loss of reference mstrst clkrst extrst test test synch test mode mstrst extrst system cpu32 asynch reset instruction extrst
motorola system integration module MC68336/376 5-42 user? manual 5.7.3.1 data bus mode selection all data lines have weak internal pull-up drivers. when pins are held high by the inter- nal drivers, the mcu uses a default operating configuration. however, specific lines can be held low externally during reset to achieve an alternate configuration. note external bus loading can overcome the weak internal pull-up drivers on data bus lines and hold pins low during reset. use an active device to hold data bus lines low. data bus configuration logic must re- lease the bus before the first bus cycle after reset to prevent conflict with external memory devices. the first bus cycle occurs ten clkout cycles after reset is re- leased. if external mode selection logic causes a conflict of this type, an isolation re- sistor on the driven lines may be required. figure 5-16 shows a recommended method for conditioning the mode select signals. the mode configuration drivers are conditioned with r/w and ds to prevent conflicts between external devices and the mcu when reset is asserted. if external reset is asserted during an external write cycle, r/w conditioning (as shown in figure 5-16 ) prevents corruption of the data during the write. similarly, ds conditions the mode con- figuration drivers so that external reads are not corrupted when reset is asserted during an external read cycle. notes: 1. the data11 bus must remain high during reset to ensure normal operation. table 5-15 reset mode selection mode select pin default function (pin left high) alternate function (pin pulled low) data0 csboot 16-bit csboot 8-bit data1 cs0 cs1 cs2 br bg bgack data2 cs3 cs4 cs5 fc0 fc1 fc2 data3 data4 data5 data6 data7 cs6 cs[7:6] cs[8:6] cs[9:6] cs[10:6] addr19 addr[20:19] addr[21:19] addr[22:19] addr[23:19] data8 dsack[1:0] , avec , ds , as , siz[1:0] porte data9 irq[7:1] modclk portf data11 normal operation 1 reserved modclk vco = system clock extal = system clock bkpt background mode disabled background mode enabled
MC68336/376 system integration module motorola user? manual 5-43 figure 5-16 preferred circuit for data bus mode select conditioning alternate methods can be used for driving data bus pins low during reset. figure 5-17 shows two of these options. the simplest is to connect a resistor in series with a diode from the data bus pin to the reset line. a bipolar transistor can be used for the same purpose, but an additional current limiting resistor must be connected between the base of the transistor and the reset pin. if a mosfet is substituted for the bipolar transistor, only the 1 k w isolation resistor is required. these simpler circuits do not offer the protection from potential memory corruption during reset assertion as does the circuit shown in figure 5-16 . reset ds r/w v dd v dd v dd in8 out8 tie inputs high or low as needed oe tie inputs high or low as needed data0 data7 data8 data15 10 k w 10 k w 820 w out1 in1 74hc244 in8 out8 oe out1 in1 74hc244 data bus select conditioning
motorola system integration module MC68336/376 5-44 user? manual figure 5-17 alternate circuit for data bus mode select conditioning data bus mode select current is specified in table a-5 . do not confuse pin function with pin electrical state. refer to 5.7.5 pin states during reset for more information. unlike other chip-select signals, the boot rom chip-select (csboot ) is active at the release of reset . during reset exception processing, the mcu fetches initialization vectors beginning at address $000000 in supervisor program space. an external memory device containing vectors located at these addresses can be enabled by cs boot after a reset. the logic level of data0 during reset selects boot rom port size for dynamic bus al- location. when data0 is held low, port size is eight bits; when data0 is held high, either by the weak internal pull-up driver or by an external pull-up, port size is 16 bits. refer to 5.9.4 chip-select reset operation for more information. data1 and data2 determine the functions of cs[2:0] and cs[5:3] , respectively. data[7:3] determine the functions of an associated chip-select and all lower-num- bered chip-selects down through cs6 . for example, if data5 is pulled low during re- set, cs[8:6] are assigned alternate function as addr[21:19], and cs[10:9] remain chip-selects. refer to 5.9.4 chip-select reset operation for more information. data8 determines the function of the dsack[1:0] , avec , ds , as , and size pins. if data8 is held low during reset, these pins are assigned to i/o port e. data9 determines the function of interrupt request pins irq[7:1] and the clock mode select pin (modclk). when data9 is held low during reset, these pins are assigned to i/o port f. 5.7.3.2 clock mode selection the state of the clock mode (modclk) pin during reset determines what clock source the mcu uses. when modclk is held high during reset, the clock signal is generated from a reference frequency using the clock synthesizer. when modclk is held low during reset, the clock synthesizer is disabled, and an external system clock signal must be applied. refer to 5.3 system clock for more information. reset 1 kw data pin data pin reset 2 kw 1n4148 2n3906 1 kw alternate data bus condition circuit
MC68336/376 system integration module motorola user? manual 5-45 note the modclk pin can also be used as parallel i/o pin pf0. to pre- vent inadvertent clock mode selection by logic connected to port f, use an active device to drive modclk during reset. 5.7.3.3 breakpoint mode selection background debug mode (bdm) is enabled when the breakpoint (bkpt ) pin is sam- pled at a logic level zero at the release of reset . subsequent assertion of the bkpt pin or the internal breakpoint signal (for instance, the execution of the cpu32 bkpt instruction) will place the cpu32 in bdm. if bkpt is sampled at a logic level one at the rising edge of reset , bdm is disabled. assertion of the bkpt pin or execution of the execution of the bkpt instruction will result in normal breakpoint exception processing. bdm remains enabled until the next system reset. bkpt is relatched on each rising transition of reset . bkpt is internally synchronized and must be held low for at least two clock cycles prior to reset negation for bdm to be enabled. bkpt assertion logic must be designed with special care. if bkpt assertion extends into the first bus cycle following the release of reset , the bus cycle could inadvertently be tagged with a breakpoint. refer to 4.10.2 background debug mode and the cpu32 reference manual (cpu32rm/ad) for more information on background debug mode. refer to the sim reference manual (simrm/ad) and appendix a electrical characteris- tics for more information concerning bkpt signal timing. 5.7.4 mcu module pin function during reset usually, module pins default to port functions and input/output ports are set to the input state. this is accomplished by disabling pin functions in the appropriate control regis- ters, and by clearing the appropriate port data direction registers. refer to individual module sections in this manual for more information. table 5-16 is a summary of mod- ule pin function out of reset.
motorola system integration module MC68336/376 5-46 user? manual 5.7.5 pin states during reset it is important to keep the distinction between pin function and pin electrical state clear. although control register values and mode select inputs determine pin function, a pin driver can be active, inactive or in high-impedance state while reset occurs. during power-on reset, pin state is subject to the constraints discussed in 5.7.7 power-on reset . note pins that are not used should either be configured as outputs, or (if configured as inputs) pulled to the appropriate inactive state. this decreases additional i dd caused by digital inputs floating near mid- supply level. 5.7.5.1 reset states of sim pins generally, while reset is asserted, sim pins either go to an inactive high-impedance state or are driven to their inactive states. after reset is released, mode selection occurs and reset exception processing begins. pins configured as inputs must be driv- en to the desired active state. pull-up or pull-down circuitry may be necessary. pins configured as outputs begin to function after reset is released. table 5-17 is a sum- mary of sim pin states during reset. table 5-16 module pin functions during reset module pin mnemonic function cpu32 dsi/ifetch dsi/ifetch dso/ipipe dso/ipipe bkpt /dsclk bkpt /dsclk ctm4 cpwm[8:5] discrete output ctd[10:9]/[4:3] discrete input ctm4c discrete input qadc pqa[7:5]/an[59:57] discrete input pqa[4:3]/an[56:55]/etrig[2:1] discrete input pqa[2:0]/an[54:52]/ma[2:0] discrete input pqb[7:4]/an[51:48] discrete input pqb[3:0]/an[z, y, x, w]/an[3:0] discrete input qsm pqs0/miso discrete input pqs1/mosi discrete input pqs2/sck discrete input pqs3/pcs0/ss discrete input pqs[6:4]/pcs[3:1] rxd pqs7/txd discrete input rxd discrete input toucan (mc68376 only) canrx0 toucan receive cantx0 toucan transmit tpu tpuch[15:0] tpu input t2clk tcr2 clock
MC68336/376 system integration module motorola user? manual 5-47 5.7.5.2 reset states of pins assigned to other mcu modules as a rule, module pins that are assigned to general-purpose i/o ports go into a high- impedance state following reset. other pin states are determined by individual module control register settings. refer to sections concerning modules for details. however, during power-on reset, module port pins may be in an indeterminate state for a short period. refer to 5.7.7 power-on reset for more information. 5.7.6 reset timing the reset input must be asserted for a specified minimum period for reset to occur. external reset assertion can be delayed internally for a period equal to the longest bus cycle time (or the bus monitor time-out period) in order to protect write cycles from being aborted by reset. while reset is asserted, sim pins are either in an inactive, high-impedance state or are driven to their inactive states. table 5-17 sim pin reset states pin(s) pin state while reset asserted pin state after reset released default function alternate function pin function pin state pin function pin state cs10 /addr23/eclk v dd cs10 v dd addr23 unknown cs[9:6] /addr[22:19]/pc[6:3] v dd cs[9:6] v dd addr[22:19] unknown addr[18:0] high-z addr[18:0] unknown addr[18:0] unknown as /pe5 high-z as output pe5 input avec /pe2 high-z avec input pe2 input berr high-z berr input berr input cs1 /bg v dd cs1 v dd bg v dd cs2 /bgack v dd cs2 v dd bgack input cs0 /br v dd cs0 v dd br input clkout output clkout output clkout output csboot v dd csboot v ss csboot v ss data[15:0] mode select data[15:0] input data[15:0] input ds /pe4 high-z ds output pe4 input dsack0 /pe0 high-z dsack0 input pe0 input dsack1 /pe1 high-z dsack1 input pe1 input cs[5:3] /fc[2:0]/pc[2:0] v dd cs[5:3] v dd fc[2:0] unknown halt high-z halt input halt input irq[7:1] /pf[7:1] high-z irq[7:1] input pf[7:1] input modclk/pf0 mode select modclk input pf0 input r/w high-z r/w output r/w output reset asserted reset input reset input rmc /pe3 high-z rmc output pe3 input siz[1:0]/pe[7:6] high-z siz[1:0] unknown pe[7:6] input tstme /tsc mode select tsc input tsc input
motorola system integration module MC68336/376 5-48 user? manual when an external device asserts reset for the proper period, reset control logic clocks the signal into an internal latch. the control logic drives the reset pin low for an additional 512 clkout cycles after it detects that the reset signal is no longer being externally driven to guarantee this length of reset to the entire system. if an internal source asserts a reset signal, the reset control logic asserts the reset pin for a minimum of 512 cycles. if the reset signal is still asserted at the end of 512 cycles, the control logic continues to assert the reset pin until the internal reset sig- nal is negated. after 512 cycles have elapsed, the reset pin goes to an inactive, high-impedance state for ten cycles. at the end of this 10-cycle period, the reset input is tested. when the input is at logic level one, reset exception processing begins. if, however, the reset input is at logic level zero, reset control logic drives the pin low for another 512 cycles. at the end of this period, the pin again goes to high-impedance state for ten cycles, then it is tested again. the process repeats until reset is released. 5.7.7 power-on reset when the sim clock synthesizer is used to generate system clocks, power-on reset involves special circumstances related to application of system and clock synthesizer power. regardless of clock source, voltage must be applied to the clock synthesizer power input pin v ddsyn for the mcu to operate. the following discussion assumes that v ddsyn is applied before and during reset, which minimizes crystal start-up time. when v ddsyn is applied at power-on, start-up time is affected by specific crystal pa- rameters and by oscillator circuit design. v dd ramp-up time also affects pin state dur- ing reset. refer to appendix a electrical characteristics for voltage and timing specifications. during power-on reset, an internal circuit in the sim drives the imb internal (mstrst) and external (extrst) reset lines. the power-on reset circuit releases the internal re- set line as v dd ramps up to the minimum operating voltage, and sim pins are initial- ized to the values shown in table 5-17 . when v dd reaches the minimum operating voltage, the clock synthesizer vco begins operation. clock frequency ramps up to specified limp mode frequency (f limp ). the external reset line remains asserted until the clock synthesizer pll locks and 512 clkout cycles elapse. the sim clock synthesizer provides clock signals to the other mcu modules. after the clock is running and mstrst is asserted for at least four clock cycles, these modules reset. v dd ramp time and vco frequency ramp time determine how long the four cy- cles take. worst case is approximately 15 milliseconds. during this period, module port pins may be in an indeterminate state. while input-only pins can be put in a known state by external pull-up resistors, external logic on input/output or output-only pins during this time must condition the lines. active drivers require high-impedance buffers or isolation resistors to prevent conflict.
MC68336/376 system integration module motorola user? manual 5-49 figure 5-18 is a timing diagram for power-on reset. it shows the relationships between reset , v dd , and bus signals. figure 5-18 power-on reset 5.7.8 use of the three-state control pin asserting the three-state control (tsc) input causes the mcu to put all output drivers in a disabled, high-impedance state. the signal must remain asserted for approxi- mately ten clock cycles in order for drivers to change state. when the internal clock synthesizer is used (modclk held high during reset), synthe- sizer ramp-up time affects how long the ten cycles take. worst case is approximately 20 milliseconds from tsc assertion. when an external clock signal is applied (modclk held low during reset), pins go to high-impedance state as soon after tsc assertion as approximately ten clock pulses have been applied to the extal pin. note when tsc assertion takes effect, internal signals are forced to values that can cause inadvertent mode selection. once the output drivers change state, the mcu must be powered down and restarted before normal operation can resume. 32 por tim clkout vco lock bus cycles reset v dd notes: 1. internal start-up time 2. first instruction fetched 2 clocks 512 clocks 10 clocks 1 2 address and control signals three-stated bus state unknown
motorola system integration module MC68336/376 5-50 user? manual 5.7.9 reset processing summary to prevent write cycles in progress from being corrupted, a reset is recognized at the end of a bus cycle instead of at an instruction boundary. any processing in progress at the time a reset occurs is aborted. after sim reset control logic has synchronized an internal or external reset request, the mstrst signal is asserted. the following events take place when mstrst is asserted: a. instruction execution is aborted. b. the status register is initialized. 1. the t0 and t1 bits are cleared to disable tracing. 2. the s bit is set to establish supervisor privilege level. 3. the interrupt priority mask is set to $7, disabling all interrupts below priority 7. c. the vector base register is initialized to $000000. the following events take place when mstrst is negated after assertion. a. the cpu32 samples the bkpt input. b. the cpu32 fetches the reset vector: 1. the first long word of the vector is loaded into the interrupt stack pointer. 2. the second long word of the vector is loaded into the program counter. 3. vectors can be fetched from external rom enabled by the csboot signal. c. the cpu32 fetches and begins decoding the first instruction to be executed. 5.7.10 reset status register the reset status register (rsr) contains a bit for each reset source in the mcu. when a reset occurs, a bit corresponding to the reset type is set. when multiple causes of reset occur at the same time, only one bit in rsr may be set. the reset status register is updated by the reset control logic when the reset signal is released. refer to d.2.4 reset status register for more information. 5.8 interrupts interrupt recognition and servicing involve complex interaction between the sim, the cpu32, and a device or module requesting interrupt service. the following paragraphs provide an overview of the entire interrupt process. chip- select logic can also be used to terminate the iack cycle with either avec or dsack . refer to 5.9 chip-selects for more information. 5.8.1 interrupt exception processing the cpu32 processes interrupts as a type of asynchronous exception. an exception is an event that preempts normal processing. each exception has an assigned vector in an exception vector table that points to an associated handler routine. the cpu32 uses vector numbers to calculate displacement into the table. during exception pro- cessing, the cpu fetches the appropriate vector and executes the exception handler routine to which the vector points.
MC68336/376 system integration module motorola user? manual 5-51 at the release of reset, the exception vector table is located beginning at address $000000. this value can be changed by programming the vector base register (vbr) with a new value. multiple vector tables can be used. refer to 4.9 exception process- ing for more information. 5.8.2 interrupt priority and recognition the cpu32 provides seven levels of interrupt priority (1-7), seven automatic interrupt vectors, and 200 assignable interrupt vectors. all interrupts with priorities less than seven can be masked by the interrupt priority (ip) field in status register. note exceptions such as ?ddress error?are not interrupts and have no ?evel?associated. exceptions cannot ever be masked. there are seven interrupt request signals (irq[7:1] ). these signals are used internally on the imb, and have corresponding pins for external interrupt service requests. the cpu32 treats all interrupt requests as though they come from internal modules; exter- nal interrupt requests are treated as interrupt service requests from the sim. each of the interrupt request signals corresponds to an interrupt priority. irq1 has the lowest priority and irq7 the highest. interrupt recognition is determined by interrupt priority level and interrupt priority (ip) mask value. the interrupt priority mask consists of three bits in the cpu32 status reg- ister. binary values %000 to %111 provide eight priority masks. masks prevent an in- terrupt request of a priority less than or equal to the mask value from being recognized and processed. irq7 , however, is always recognized, even if the mask value is %111. irq[7:1] are active-low level-sensitive inputs. the low on the pin must remain asserted until an interrupt acknowledge cycle corresponding to that level is detected. irq7 is transition-sensitive as well as level-sensitive: a level-7 interrupt is not detected unless a falling edge transition is detected on the irq7 line. this prevents redundant servicing and stack overflow. a non-maskable interrupt is generated each time irq7 is asserted as well as each time the priority mask is written while irq7 is asserted. if irq7 is asserted and the ip mask is written to any new value (including %111), irq7 will be recognized as a new irq7 . interrupt requests are sampled on consecutive falling edges of the system clock. in- terrupt request input circuitry has hysteresis. to be valid, a request signal must be as- serted for at least two consecutive clock periods. valid requests do not cause immediate exception processing, but are left pending. pending requests are pro- cessed at instruction boundaries or when exception processing of higher-priority interrupts is complete.
motorola system integration module MC68336/376 5-52 user? manual the cpu32 does not latch the priority of a pending interrupt request. if an interrupt source of higher priority makes a service request while a lower priority request is pend- ing, the higher priority request is serviced. if an interrupt request with a priority equal to or lower than the current ip mask value is made, the cpu32 does not recognize the occurrence of the request. if simultaneous interrupt requests of different priorities are made, and both have a priority greater than the mask value, the cpu32 recognizes the higher-level request. 5.8.3 interrupt acknowledge and arbitration when the cpu32 detects one or more interrupt requests of a priority higher than the interrupt priority mask value, it places the interrupt request level on the address bus and initiates a cpu space read cycle. the request level serves two purposes: it is de- coded by modules or external devices that have requested interrupt service, to deter- mine whether the current interrupt acknowledge cycle pertains to them, and it is latched into the interrupt priority mask field in the cpu32 status register to preclude further interrupts of lower priority during interrupt service. modules or external devices that have requested interrupt service must decode the ip mask value placed on the address bus during the interrupt acknowledge cycle and re- spond if the priority of the service request corresponds to the mask value. however, before modules or external devices respond, interrupt arbitration takes place. arbitration is performed by means of serial contention between values stored in indi- vidual module interrupt arbitration (iarb) fields. each module that can make an inter- rupt service request, including the sim, has an iarb field in its configuration register. iarb fields can be assigned values from %0000 to %1111. in order to implement an arbitration scheme, each module that can request interrupt service must be assigned a unique, non-zero iarb field value during system initialization. arbitration priorities range from %0001 (lowest) to %1111 (highest) ?if the cpu recognizes an interrupt service request from a source that has an iarb field value of %0000, a spurious inter- rupt exception is processed. warning do not assign the same arbitration priority to more than one module. when two or more iarb fields have the same nonzero value, the cpu32 interprets multiple vector numbers at the same time, with un- predictable consequences. because the ebi manages external interrupt requests, the sim iarb value is used for arbitration between internal and external interrupt requests. the reset value of iarb for the sim is %1111, and the reset iarb value for all other modules is %0000. although arbitration is intended to deal with simultaneous requests of the same interrupt level, it always takes place, even when a single source is requesting service. this is important for two reasons: the ebi does not transfer the interrupt acknowledge read cycle to the external bus unless the sim wins contention, and failure to contend causes the interrupt acknowledge bus cycle to be terminated early by a bus error.
MC68336/376 system integration module motorola user? manual 5-53 when arbitration is complete, the module with both the highest asserted interrupt level and the highest arbitration priority must terminate the bus cycle. internal modules place an interrupt vector number on the data bus and generate appropriate internal cycle termination signals. in the case of an external interrupt request, after the interrupt acknowledge cycle is transferred to the external bus, the appropriate external device must respond with a vector number, then generate data and size acknowledge (dsack ) termination signals, or it must assert the autovector (avec ) request signal. if the device does not respond in time, the sim bus monitor, if enabled, asserts the bus error signal (berr ), and a spurious interrupt exception is taken. chip-select logic can also be used to generate internal avec or dsack signals in re- sponse to interrupt requests from external devices. refer to 5.9.3 using chip-select signals for interrupt acknowledge for more information. chip-select address match logic functions only after the ebi transfers an interrupt acknowledge cycle to the exter- nal bus following iarb contention. if an internal module makes an interrupt request of a certain priority, and the appropriate chip-select registers are programmed to gener- ate avec or dsack signals in response to an interrupt acknowledge cycle for that priority level, chip-select logic does not respond to the interrupt acknowledge cycle, and the internal module supplies a vector number and generates internal cycle termi- nation signals. for periodic timer interrupts, the pirq[2:0] field in the periodic interrupt control register (picr) determines pit priority level. a pirq[2:0] value of %000 means that pit inter- rupts are inactive. by hardware convention, when the cpu32 receives simultaneous interrupt requests of the same level from more than one sim source (including external devices), the periodic interrupt timer is given the highest priority, followed by the irq pins. 5.8.4 interrupt processing summary a summary of the entire interrupt processing sequence follows. when the sequence begins, a valid interrupt service request has been detected and is pending. a. the cpu32 finishes higher priority exception processing or reaches an instruc- tion boundary. b. the processor state is stacked. the s bit in the status register is set, establish- ing supervisor access level, and bits t1 and t0 are cleared, disabling tracing. c. the interrupt acknowledge cycle begins: 1. fc[2:0] are driven to %111 (cpu space) encoding. 2. the address bus is driven as follows: addr[23:20] = %1111; addr[19:16] = %1111, which indicates that the cycle is an interrupt acknowledge cpu space cycle; addr[15:4] = %111111111111; addr[3:1] = the priority of the interrupt request being acknowledged; and addr0 = %1. 3. the request level is latched from the address bus into the ip mask field in the status register. d. modules that have requested interrupt service decode the priority value on addr[3:1]. if request priority is the same as acknowledged priority, arbitration by iarb contention takes place.
motorola system integration module MC68336/376 5-54 user? manual e. after arbitration, the interrupt acknowledge cycle is completed in one of the fol- lowing ways: 1. when there is no contention (iarb = %0000), the spurious interrupt monitor asserts berr , and the cpu32 generates the spurious interrupt vector num- ber. 2. the dominant interrupt source (external or internal) supplies a vector num- ber and dsack signals appropriate to the access. the cpu32 acquires the vector number. 3. the avec signal is asserted (the signal can be asserted by the dominant external interrupt source or the pin can be tied low), and the cpu32 gener- ates an autovector number corresponding to interrupt priority. 4. the bus monitor asserts berr and the cpu32 generates the spurious in- terrupt vector number. f. the vector number is converted to a vector address. g. the content of the vector address is loaded into the pc and the processor transfers control to the exception handler routine. 5.8.5 interrupt acknowledge bus cycles interrupt acknowledge bus cycles are cpu32 space cycles that are generated during exception processing. for further information about the types of interrupt acknowledge bus cycles determined by avec or dsack , refer to appendix a electrical characteristics and the sim reference manual (simrm/ad). 5.9 chip-selects typical microcontrollers require additional hardware to provide external chip-select and address decode signals. the mcu includes 12 programmable chip-select circuits that can provide 2 to 16 clock-cycle access to external memory and peripherals. address block sizes of two kbytes to one mbyte can be selected. figure 5-19 is a diagram of a basic system that uses chip-selects.
MC68336/376 system integration module motorola user? manual 5-55 figure 5-19 basic mcu system dtack r/w cs rs[4:1] d[7:0] irq iack dsack0 dsack1 irq7 csboot cs0 cs1 cs2 cs3 cs4 r/w addr[17:0] data[15:0] v dd v dd v dd v dd v dd v dd addr[3:0] data[15:8] ce oe a[16:0] dq[15:0] addr[17:1] data[15:0] v dd e g a[14:0] dq[7:0] w addr[15:1] data[15:8] v dd v dd e g a[14:0] dq[7:0] w addr[15:1] data[7:0] v dd mc68hc681 mcm6206d MC68336/376 we 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w 10 k w (async bus peripheral) (flash 64k x 16) (sram 32k x 8) mcm6206d (sram 32k x 8) 68300 sim/scim bus
motorola system integration module MC68336/376 5-56 user? manual chip-select assertion can be synchronized with bus control signals to provide output enable, read/write strobe, or interrupt acknowledge signals. chip-select logic can also generate dsack and avec signals internally. a single dsack generator is shared by all chip-selects. each signal can also be synchronized with the eclk signal avail- able on addr23. when a memory access occurs, chip-select logic compares address space type, ad- dress, type of access, transfer size, and interrupt priority (in the case of interrupt ac- knowledge) to parameters stored in chip-select registers. if all parameters match, the appropriate chip-select signal is asserted. select signals are active low. if a chip-select function is given the same address as a microcontroller module or an internal memory array, an access to that address goes to the module or array, and the chip-select signal is not asserted. the external address and data buses do not reflect the internal access. all chip-select circuits are configured for operation out of reset. however, all chip-se- lect signals except csboot are disabled, and cannot be asserted until the byte[1:0] field in the corresponding option register is programmed to a non-zero value to select a transfer size. the chip-select option register must not be written until a base address has been written to a proper base address register. alternate functions for chip-select pins are enabled if appropriate data bus pins are held low at the release of reset . refer to 5.7.3.1 data bus mode selection for more information. figure 5-20 is a functional diagram of a single chip-select circuit. figure 5-20 chip-select circuit block diagram chip sel block avec generator dsack generator pin assignment register pin data register base address register timing and control address comparator option compare option register avec dsack pin bus control internal signals address
MC68336/376 system integration module motorola user? manual 5-57 5.9.1 chip-select registers each chip-select pin can have one or more functions. chip-select pin assignment reg- isters cspar[0:1] determine functions of the pins. pin assignment registers also de- termine port size (8- or 16-bit) for dynamic bus allocation. a pin data register (portc) latches data for chip-select pins that are used for discrete output. blocks of addresses are assigned to each chip-select function. block sizes of two kbytes to one mbyte can be selected by writing values to the appropriate base address register (csbar[0:10] and csbarbt). multiple chip-selects assigned to the same block of addresses must have the same number of wait states. the base address reg- ister for a chip-select line should be written to a value that is an exact integer multiple of both the block size and the size of the memory device being selected. chip-select option registers (csorbt and csor[0:10]) determine timing of and con- ditions for assertion of chip-select signals. eight parameters, including operating mode, access size, synchronization, and wait state insertion can be specified. initialization software usually resides in a peripheral memory device controlled by the chip-select circuits. a set of special chip-select functions and registers (csorbt and csbarbt) is provided to support bootstrap operation. comprehensive address maps and register diagrams are provided in appendix d register summary . 5.9.1.1 chip-select pin assignment registers the pin assignment registers contain twelve 2-bit fields that determine the functions of the chip-select pins. each pin has two or three possible functions, as shown in table 5-18 . table 5-19 shows pin assignment field encoding. pins that have no discrete output function must not use the %00 encoding as this will cause the alternate function to be selected. for instance, %00 for cs0 /br will cause the pin to perform the br function. table 5-18 chip-select pin functions chip-select alternate function discrete output csboot csboot ? cs0 br ? cs1 bg ? cs2 bgack ? cs3 fc0 pc0 cs4 fc1 pc1 cs5 fc2 pc2 cs6 addr19 pc3 cs7 addr20 pc4 cs8 addr21 pc5 cs9 addr22 pc6 cs10 addr23 eclk
motorola system integration module MC68336/376 5-58 user? manual port size determines the way in which bus transfers to an external address are allo- cated. port size of eight bits or sixteen bits can be selected when a pin is assigned as a chip-select. port size and transfer size affect how the chip-select signal is asserted. refer to 5.9.1.3 chip-select option registers for more information. out of reset, chip-select pin function is determined by the logic level on a correspond- ing data bus pin. the data bus pins have weak internal pull-up drivers, but can be held low by external devices. refer to 5.7.3.1 data bus mode selection for more informa- tion. either 16-bit chip-select function (%11) or alternate function (%01) can be select- ed during reset. all pins except the boot rom select pin (csboot ) are disabled out of reset. there are twelve chip-select functions and only eight associated data bus pins. there is not a one-to-one correspondence. refer to 5.9.4 chip-select reset operation for more detailed information. the csboot signal is enabled out of reset. the state of the data0 line during reset determines what port width csboot uses. if data0 is held high (either by the weak internal pull-up driver or by an external pull-up device), 16-bit port size is selected. if data0 is held low, 8-bit port size is selected. a pin programmed as a discrete output drives an external signal to the value specified in the port c register. no discrete output function is available on pins csboot , br , bg , or bgack . addr23 provides the eclk output rather than a discrete output sig- nal. when a pin is programmed for discrete output or alternate function, internal chip-select logic still functions and can be used to generate dsack or avec internally on an ad- dress and control signal match. 5.9.1.2 chip-select base address registers each chip-select has an associated base address register. a base address is the low- est address in the block of addresses enabled by a chip-select. block size is the extent of the address block above the base address. block size is determined by the value contained in blksz[2:0]. multiple chip-selects assigned to the same block of addresses must have the same number of wait states. blksz[2:0] determines which bits in the base address field are compared to corre- sponding bits on the address bus during an access. provided other constraints deter- mined by option register fields are also satisfied, when a match occurs, the associated chip-select signal is asserted. table 5-20 shows blksz[2:0] encoding. table 5-19 pin assignment field encoding csxpa[1:0] description 00 discrete output 01 alternate function 10 chip-select (8-bit port) 11 chip-select (16-bit port)
MC68336/376 system integration module motorola user? manual 5-59 the chip-select address compare logic uses only the most significant bits to match an address within a block. the value of the base address must be an integer multiple of the block size. after reset, the mcu fetches the initialization routine from the address contained in the reset vector, located beginning at address $000000 of program space. to support bootstrap operation from reset, the base address field in the boot chip-select base ad- dress register (csbarbt) has a reset value of $000, which corresponds to a base ad- dress of $000000 and a block size of one mbyte. a memory device containing the reset vector and initialization routine can be automatically enabled by csboot after a re- set. refer to 5.9.4 chip-select reset operation for more information. 5.9.1.3 chip-select option registers option register fields determine timing of and conditions for assertion of chip-select signals. to assert a chip-select signal, and to provide dsack or autovector support, other constraints set by fields in the option register and in the base address register must also be satisfied. the following paragraphs summarize option register functions. refer to d.2.21 chip-select option registers for register and bit field information. the mode bit determines whether chip-select assertion simulates an asynchronous bus cycle, or is synchronized to the m6800-type bus clock signal eclk available on addr23. refer to 5.3 system clock for more information on eclk. byte[1:0] controls bus allocation for chip-select transfers. port size, set when a chip- select is enabled by a pin assignment register, affects signal assertion. when an 8-bit port is assigned, any byte field value other than %00 enables the chip-select signal. when a 16-bit port is assigned, however, byte field value determines when the chip- select is enabled. the byte fields for cs[10:0] are cleared during reset. however, both bits in the boot rom chip-select option register (csorbt) byte field are set (%11) when the reset signal is released. r/w [1:0] causes a chip-select signal to be asserted only for a read, only for a write, or for both read and write. use this field in conjunction with the strb bit to generate asynchronous control signals for external devices. table 5-20 block size encoding blksz[2:0] block size address lines compared 000 2 kbytes addr[23:11] 001 8 kbytes addr[23:13] 010 16 kbytes addr[23:14] 011 64 kbytes addr[23:16] 100 128 kbytes addr[23:17] 101 256 kbytes addr[23:18] 110 512 kbytes addr[23:19] 111 1 mbyte addr[23:20]
motorola system integration module MC68336/376 5-60 user? manual the strb bit controls the timing of a chip-select assertion in asynchronous mode. se- lecting address strobe causes a chip-select signal to be asserted synchronized with the address strobe. selecting data strobe causes a chip-select signal to be asserted synchronized with the data strobe. this bit has no effect in synchronous mode. dsack[3:0] specifies the source of dsack in asynchronous mode. it also allows the user to optimize bus speed in a particular application by controlling the number of wait states that are inserted. note the external dsack pins are always active. space[1:0] determines the address space in which a chip-select is asserted. an ac- cess must have the space type represented by the space[1:0] encoding in order for a chip-select signal to be asserted. ipl[2:0] contains an interrupt priority mask that is used when chip-select logic is set to trigger on external interrupt acknowledge cycles. when space[1:0] is set to %00 (cpu space), interrupt priority (addr[3:1]) is compared to the ipl field. if the values are the same, and other option register constraints are satisfied, a chip-select signal is asserted. this field only affects the response of chip-selects and does not affect in- terrupt recognition by the cpu. encoding %000 in the ipl field causes a chip-select signal to be asserted regardless of interrupt acknowledge cycle priority, provided all other constraints are met. the avec bit is used to make a chip-select respond to an interrupt acknowledge cycle. if the avec bit is set, an autovector will be selected for the particular external interrupt being serviced. if avec is zero, the interrupt acknowledge cycle will be ter- minated with dsack , and an external vector number must be supplied by an external device. 5.9.1.4 port c data register the port c data register latches data for portc pins programmed as discrete out- puts. when a pin is assigned as a discrete output, the value in this register appears at the output. pc[6:0] correspond to cs[9:3] . bit 7 is not used. writing to this bit has no effect, and it always reads zero. 5.9.2 chip-select operation when the mcu makes an access, enabled chip-select circuits compare the following items: ?function codes to space fields, and to the ipl field if the space field encoding is not for cpu space. ?appropriate address bus bits to base address fields. ?read/write status to r/w fields. ?addr0 and/or siz[1:0] bits to byte fields (16-bit ports only). ?priority of the interrupt being acknowledged (addr[3:1]) to ipl fields (when the access is an interrupt acknowledge cycle).
MC68336/376 system integration module motorola user? manual 5-61 when a match occurs, the chip-select signal is asserted. assertion occurs at the same time as as or ds assertion in asynchronous mode. assertion is synchronized with eclk in synchronous mode. in asynchronous mode, the value of the dsack field de- termines whether dsack is generated internally. dsack[3:0] also determines the number of wait states inserted before internal dsack assertion. the speed of an external device determines whether internal wait states are needed. normally, wait states are inserted into the bus cycle during s3 until a peripheral as- serts dsack . if a peripheral does not generate dsack , internal dsack generation must be selected and a predetermined number of wait states can be programmed into the chip-select option register. refer to the sim reference manual (simrm/ad) for further information. 5.9.3 using chip-select signals for interrupt acknowledge ordinary bus cycles use supervisor or user space access, but interrupt acknowledge bus cycles use cpu space access. refer to 5.6.4 cpu space cycles and 5.8 inter- rupts for more information. there are no differences in flow for chip-selects in each type of space, but base and option registers must be properly programmed for each type of external bus cycle. during a cpu space cycle, bits [15:3] of the appropriate base register must be config- ured to match addr[23:11], as the address is compared to an address generated by the cpu. figure 5-21 shows cpu space encoding for an interrupt acknowledge cycle. fc[2:0] are set to %111, designating cpu space access. addr[3:1] indicate interrupt priority, and the space type field (addr[19:16]) is set to %1111, the interrupt acknowledge code. the rest of the address lines are set to one. figure 5-21 cpu space encoding for interrupt acknowledge 11111111111111111111 1 111 level 19 16 23 function code 20 0 cpu space type field address bus interrupt acknowledge cpu space iack tim
motorola system integration module MC68336/376 5-62 user? manual because address match logic functions only after the ebi transfers an interrupt ac- knowledge cycle to the external address bus following iarb contention, chip-select logic generates avec or dsack signals only in response to interrupt requests from external irq pins. if an internal module makes an interrupt request of a certain priority, and the chip-select base address and option registers are programmed to generate avec or dsack signals in response to an interrupt acknowledge cycle for that priority level, chip-select logic does not respond to the interrupt acknowledge cycle, and the internal module supplies a vector number and generates an internal dsack signal to terminate the cycle. perform the following operations before using a chip-select to generate an interrupt acknowledge signal: 1. program the base address field to all ones. 2. program block size to no more than 64 kbytes, so that the address comparator checks addr[19:16] against the corresponding bits in the base address regis- ter. (the cpu32 places the cpu space bus cycle type on addr[19:16].) 3. set the r/w field to read only. an interrupt acknowledge cycle is performed as a read cycle. 4. set the byte field to lower byte when using a 16-bit port, as the external vector for a 16-bit port is fetched from the lower byte. set the byte field to upper byte when using an 8-bit port. if an interrupting device does not provide a vector number, an autovector acknowl- edge must be generated, either by asserting the avec pin or by generating avec internally using the chip-select option register. this terminates the bus cycle. 5.9.4 chip-select reset operation the least significant bit of each of the 2-bit chip-select pin assignment fields in cspar0 and cspar1 each have a reset value of one. the reset values of the most significant bits of each field are determined by the states of data[7:1] during reset. there are weak internal pull-up drivers for each of the data lines so that chip-select operation is selected by default out of reset. however, the internal pull-up drivers can be overcome by bus loading effects. to ensure a particular configuration out of reset, use an active device to put the data lines in a known state during reset. the base address fields in chip-select base ad- dress registers csbar[0:10] and chip-select option registers csor[0:10] have the re- set values shown in table 5-21 . the byte fields of csor[0:10] have a reset value of ?isable? so that a chip-select signal cannot be asserted until the base and option reg- isters are initialized.
MC68336/376 system integration module motorola user? manual 5-63 following reset, the mcu fetches the initial stack pointer and program counter values from the exception vector table, beginning at $000000 in supervisor program space. the csboot chip-select signal is used to select an external boot device mapped to a base address of $000000. the msb of the csbtpa field in cspar0 has a reset value of one, so that chip-select function is selected by default out of reset. the byte field in chip-select option register csorbt has a reset value of ?oth bytes?so that the select signal is enabled out of reset. the lsb of the csboot field, determined by the logic level of data0 during reset, selects the boot rom port size. when data0 is held low during reset, port size is eight bits. when data0 is held high during reset, port size is 16 bits. data0 has a weak internal pull-up driver, so that a 16-bit port is selected by default out of reset. however, the internal pull-up driver can be overcome by bus loading effects. to en- sure a particular configuration out of reset, use an active device to put data0 in a known state during reset. the base address field in the boot chip-select base address register csbarbt has a reset value of all zeros, so that when the initial access to address $000000 is made, an address match occurs, and the csboot signal is asserted. the block size field in csbarbt has a reset value of one mbyte. table 5-22 shows csboot reset values. notes: 1. these fields are not used unless ?ddress space?is set to cpu space. table 5-21 chip-select base and option register reset values fields reset values base address $000000 block size 2 kbyte async/sync mode asynchronous mode upper/lower byte disabled read/write disabled as /ds as dsack no wait states address space cpu space ipl any level autovector external interrupt vector table 5-22 csboot base and option register reset values fields reset values base address $000000 block size 1 mbyte async/sync mode asynchronous mode upper/lower byte both bytes read/write read/write as /ds as dsack 13 wait states address space supervisor/user space ipl 1 any level autovector interrupt vector externally
motorola system integration module MC68336/376 5-64 user? manual 5.10 parallel input/output ports sixteen sim pins can be configured for general-purpose discrete input and output. al- though these pins are organized into two ports, port e and port f, function assignment is by individual pin. pin assignment registers, data direction registers, and data regis- ters are used to implement discrete i/o. 5.10.1 pin assignment registers bits in the port e and port f pin assignment registers (pepar and pfpar) control the functions of the pins on each port. any bit set to one defines the corresponding pin as a bus control signal. any bit cleared to zero defines the corresponding pin as an i/o pin. 5.10.2 data direction registers bits in the port e and port f data direction registers (ddre and ddrf) control the direction of the pin drivers when the pins are configured as i/o. any bit in a register set to one configures the corresponding pin as an output. any bit in a register cleared to zero configures the corresponding pin as an input. these registers can be read or written at any time. 5.10.3 data registers a write to the port e and port f data registers (porte[0:1] and portf[0:1]) is stored in an internal data latch, and if any pin in the corresponding port is configured as an output, the value stored for that bit is driven out on the pin. a read of a data register returns the value at the pin only if the pin is configured as a discrete input. otherwise, the value read is the value stored in the port data register. both data registers can be accessed in two locations and can be read or written at any time. 5.11 factory test the test submodule supports scan-based testing of the various mcu modules. it is in- tegrated into the sim to support production test. test submodule registers are intend- ed for motorola use only. register names and addresses are provided in d.2.2 system integration test register and d.2.5 system integration test register (eclk) to show the user that these addresses are occupied. the quot pin is also used for factory test.
MC68336/376 standby ram module motorola user? manual 6-1 section 6 standby ram module the standby ram (sram) module consists of a control register block and a 4-kbyte array of fast (two bus cycle) static ram. the sram is especially useful for system stacks and variable storage. the sram can be mapped to any address that is a multiple of the array size so long as sram boundaries do not overlap the module con- trol registers (overlap makes the registers inaccessible). data can be read/written in bytes, words or long words. sram is powered by v dd in normal operation. during pow- er-down, sram contents can be maintained by power from the v stby input. power switching between sources is automatic. 6.1 sram register block there are four sram control registers: the ram module configuration register (ram- mcr), the ram test register (ramtst), and the ram array base address registers (rambah/rambal). to protect these registers from accidental modification, they are always mapped to supervisor data space. the module mapping bit (mm) in the sim configuration register defines the most sig- nificant bit (addr23) of the imb address for each MC68336/376 module. refer to 5.2.1 module mapping for information on how the state of mm affects the system. the sram control register consists of eight bytes, but not all locations are implemented. unimplemented register addresses are read as zeros, and writes have no effect. refer to d.3 standby ram module for register block address map and reg- ister bit/field definitions. 6.2 sram array address mapping base address registers rambah and rambal are used to specify the sram array base address in the memory map. rambah and rambal can only be written while the sram is in low-power stop mode (rammcr stop = 1) and the base address lock (rammcr rlck = 0) is disabled. rlck can be written once only to a value of one. this prevents accidental remapping of the array. 6.3 sram array address space type rasp[1:0] in rammcr determine the sram array address space type. the sram module can respond to both program and data space accesses or to program space accesses only. this allows code to be executed from ram, and permits use of pro- gram counter relative addressing mode for operand fetches from the array. in addition, rasp[1:0] specify whether access to the sram module can be made in supervisor mode only, or in either user or supervisor mode. if supervisor-only access is specified, accesses in user mode are ignored by the sram control logic and can be decoded externally. 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola standby ram module MC68336/376 6-2 user? manual table 6-1 shows rasp[1:0] field encodings. refer to 4.5 addressing modes for more information on addressing modes. refer to 5.5.1.7 function codes for more information concerning address space types and program/data space access. 6.4 normal access the array can be accessed by byte, word, or long word. a byte or aligned word access takes one bus cycle or two system clocks. a long word access requires two bus cycles. misaligned accesses are not permitted by the cpu32 and will result in an address error exception. refer to 5.6 bus operation for more information concerning access times. 6.5 standby and low-power stop operation standby and low-power modes should not be confused. standby mode maintains the ram array when the main mcu power supply is turned off. low-power stop mode al- lows the central processor unit to control mcu power consumption. relative voltage levels of the mcu v dd and v stby pins determine whether the sram is in standby mode. sram circuitry switches to the standby power source when v dd drops below specified limits. if specified standby supply voltage levels are maintained during the transition, there is no loss of memory when switching occurs. the ram array cannot be accessed while the sram module is powered from v stby . if standby operation is not desired, connect the v stby pin to v ss . i sb (sram standby current) values may vary while v dd transitions occur. refer to ap- pendix a electrical characteristics for standby switching and power con- sumption specifications. setting the stop bit in rammcr switches the sram module to low-power stop mode. in low-power stop mode, the array retains its contents, but cannot be read or written by the cpu32. stop can be written only when the cpu32 is operating in supervisor mode. the sram module will switch to standby mode while it is in low-power stop mode, provided the operating constraints discussed above are met. table 6-1 sram array address space type rasp[1:0] space 00 unrestricted program and data 01 unrestricted program 10 supervisor program and data 11 supervisor program 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 standby ram module motorola user? manual 6-3 6.6 reset reset places the sram in low-power stop mode, enables program space access, and clears the base address registers and the register lock bit. these actions make it pos- sible to write a new base address into the registers. when a synchronous reset occurs while a byte or word sram access is in progress, the access is completed. if reset occurs during the first word access of a long-word operation, only the first word access is completed. if reset occurs during the second word access of a long-word operation, the entire access is completed. data being read from or written to the ram may be corrupted by asynchronous reset. refer to 5.7 re- set for more information about resets. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola standby ram module MC68336/376 6-4 user? manual 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 masked rom module motorola user? manual 7-1 section 7 masked rom module the masked rom module (mrm) consists of a fixed-location control register block and an 8-kbyte mask-programmed read-only memory array that can be mapped to any 8-kbyte boundary in the system memory map. the mrm can be programmed to insert wait states to accommodate migration from slow external development memory. access time depends upon the number of wait states specified, but can be as fast as two bus cycles. the mrm can be used for program accesses only, or for program and data accesses. data can be read in bytes, words or long words. the mrm can be con- figured to support system bootstrap during reset. 7.1 mrm register block there are three mrm control registers: the masked rom module configuration regis- ter (mrmcr), and the rom array base address registers (rombah and rombal). in addition, the mrm register block contains signature registers (sighi and siglo), and rom bootstrap words (rombs[0:3]). the module mapping bit (mm) in the sim configuration register defines the most significant bit (addr23) of the imb address for each MC68336/376 module. 5.2.1 module mapping contains information about how the state of mm affects the system. the mrm control register block consists of 32 bytes, but not all locations are imple- mented. unimplemented register addresses are read as zeros, and writes have no ef- fect. refer to d.4 masked rom module for register block address map and register bit/field definitions. 7.2 mrm array address mapping base address registers rombah and rombal are used to specify the rom array base address in the memory map. although the base address contained in rombah and rombal is mask-programmed, these registers can be written after reset to change the default array address if the base address lock bit (lock in mrmcr) is not masked to a value of one. the mrm array can be mapped to any 8-kbyte boundary in the memory map, but must not overlap other module control registers (overlap makes the registers inaccessible). if the array overlaps the mrm register block, addresses in the block are accessed in- stead of the corresponding array addresses. rombah and rombal can only be written while the rom is in low-power stop mode (mrmcr stop = 1) and the base address lock (mrmcr lock = 0) is disabled. lock can be written once only to a value of one. this prevents accidental remapping of the array. 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola masked rom module MC68336/376 7-2 user? manual 7.3 mrm array address space type aspc[1:0] in mrmcr determines rom array address space type. the module can respond to both program and data space accesses or to program space accesses only. this allows code to be executed from rom, and permits use of program counter relative addressing mode for operand fetches from the array. the default value of aspc[1:0] is established during mask programming, but field value can be changed after reset if the lock bit in the mrmcr has not been masked to a value of one. table 7-1 shows aspc[1:0] field encodings. refer to 4.5 addressing modes for more information on addressing modes. refer to 5.5.1.7 function codes for more information concerning address space types and program/data space access. 7.4 normal access the array can be accessed by byte, word, or long word. a byte or aligned word access takes a minimum of one bus cycle (two system clocks). a long word access requires two bus cycles. misaligned accesses are not permitted by the cpu32 and will result in an address error exception. access time can be optimized for a particular application by inserting wait states into each access. the number of wait states inserted is determined by the value of wait[1:0] in the mrmcr. two, three, four, or five bus-cycle accesses can be speci- fied. the default value wait[1:0] is established during mask programming, but field value can be changed after reset if the lock bit in the mrmcr has not been masked to a value of one. table 7-2 shows wait[1:0] field encodings. refer to 5.6 bus operation for more information concerning access times. table 7-1 rom array space type aspc[1:0] state specified 00 unrestricted program and data 01 unrestricted program 10 supervisor program and data 11 supervisor program table 7-2 wait states field wait[1:0] cycles per transfer 00 3 01 4 10 5 11 2 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 masked rom module motorola user? manual 7-3 7.5 low-power stop mode operation low-power stop mode minimizes mcu power consumption. setting the stop bit in mrmcr places the mrm in low-power stop mode. in low-power stop mode, the array cannot be accessed. the reset state of stop is the complement of the logic state of data14 during reset. low-power stop mode is exited by clearing stop. 7.6 rom signature signature registers rsighi and rsiglo contain a user-specified mask-programmed signature pattern. a special signature algorithm allows the user to verify rom array content. 7.7 reset the state of the mrm following reset is determined by the default values programmed into the mrmcr boot , lock, aspc[1:0], and wait[1:0] bits. the default array base address is determined by the values programmed into rombal and rombah. when the mask programmed value of the mrmcr boot bit is zero, the contents of mrm bootstrap words rombs[0:3] are used as reset vectors. when the mask pro- grammed value of the mrmcr boot bit is one, reset vectors are fetched from exter- nal memory, and system integration module chip-select logic is used to assert the boot rom select signal csboot . refer to 5.9.4 chip-select reset operation for more information concerning external boot rom selection. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola masked rom module MC68336/376 7-4 user? manual 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-1 section 9 queued serial module this section is an overview of the queued serial module (qsm). refer to the qsm reference manual (qsmrm/ad) for complete information about the qsm. 9.1 general the qsm contains two serial interfaces, the queued serial peripheral interface (qspi) and the serial communication interface (sci). figure 9-1 is a block diagram of the qsm. figure 9-1 qsm block diagram the qspi provides peripheral expansion or interprocessor communication through a full-duplex, synchronous, three-line bus. four programmable peripheral chip-selects can select up to sixteen peripheral devices by using an external one of sixteen line se- lector. a self-contained ram queue allows up to sixteen serial transfers of eight to six- teen bits each or continuous transmission of up to a 256-bit data stream without cpu32 intervention. a special wrap-around mode supports continuous transmission/ reception modes. qspi interface logic sci miso/pqs0 mosi/pqs1 sck/pqs2 pcs0/ss /pqs3 pcs1/pqs4 pcs2/pqs5 pcs3/pqs6 txd/pqs7 rxd port qs qsm block imb 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-2 user? manual the sci provides a standard non-return to zero (nrz) mark/space format. it operates in either full- or half-duplex mode. there are separate transmitter and receiver enable bits and dual data buffers. a modulus-type baud rate generator provides rates from 110 baud to 655 kbaud with a 20.97 mhz system clock. word length of either eight or nine bits is software selectable. optional parity generation and detection provide either even or odd parity check capability. advanced error detection circuitry catches glitches of up to 1/16 of a bit time in duration. wake-up functions allow the cpu32 to run unin- terrupted until meaningful data is available. 9.2 qsm registers and address map there are four types of qsm registers: qsm global registers, qsm pin control regis- ters, qspi registers, and sci registers. refer to 9.2.1 qsm global registers and 9.2.2 qsm pin control registers for a discussion of global and pin control registers. refer to 9.3.1 qspi registers and 9.4.1 sci registers for further information about qspi and sci registers. writes to unimplemented register bits have no effect, and reads of unimplemented bits always return zero. the qsm address map includes the qsm registers and the qspi ram. the mm bit in the system integration module configuration register (simcr) defines the most signif- icant bit (addr23) of the imb address for each module. refer to d.6 queued serial module for a qsm address map and register bit and field definitions. 5.2.1 module mapping contains more information about how the state of mm affects the system. 9.2.1 qsm global registers the qsm configuration register (qsmcr) contains parameters for interfacing to the cpu32 and the intermodule bus. the qsm test register (qtest) is used during fac- tory test of the qsm. the qsm interrupt level register (qilr) determines the priority of interrupts requested by the qsm and the vector used when an interrupt is acknowl- edged. the qsm interrupt vector register (qivr) contains the interrupt vector for both qsm submodules. qilr and qivr are 8-bit registers located at the same word ad- dress. 9.2.1.1 low-power stop operation when the stop bit in qsmcr is set, the system clock input to the qsm is disabled and the module enters a low-power operating state. qsmcr is the only register guar- anteed to be readable while stop is asserted. the qspi ram is not readable during lpstop. however, writes to ram or any register are guaranteed valid while stop is asserted. stop can be set by the cpu32 and by reset. system software must bring the qspi and sci to an orderly stop before asserting stop to avoid data corruption. the irq mask level in the cpu32 status register should be set to a higher value than the irq level generated by the qsm module. the sci receiver and transmitter should be disabled after transfers in progress are com- plete. the qspi can be halted by setting the halt bit in spcr3 and then setting stop after the halta flag is set. the irq mask in the cpu status register should be restored to its former level. refer to 5.3.4 low-power operation for more information about low-power stop mode. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-3 9.2.1.2 freeze operation the frz[1:0] bits in qsmcr are used to determine what action is taken by the qsm when the imb freeze signal is asserted. freeze is asserted when the cpu32 en- ters background debug mode. at the present time, frz0 has no effect; setting frz1 causes the qspi to halt on the first transfer boundary following freeze assertion. refer to 4.10.2 background debug mode for more information about background de- bugging mode. 9.2.1.3 qsm interrupts both the qspi and sci can generate interrupt requests. each has a separate interrupt request priority register. a single vector register is used to generate exception vector numbers. the values of the ilqspi and ilsci fields in qilr determine the priority of qspi and sci interrupt requests. the values in these fields correspond to internal interrupt re- quest signals irq[7:1] . a value of %111 causes irq7 to be asserted when a qsm in- terrupt request is made. lower field values cause correspondingly lower-numbered interrupt request signals to be asserted. setting the ilqspi or ilsci field values to %000 disables interrupts for the respective section. if ilqspi and ilsci have the same non-zero value, and the qspi and sci make simultaneous interrupt requests, the qspi has priority. when the cpu32 acknowledges an interrupt request, it places the value in the status register interrupt priority (ip) mask on the address bus. the qsm compares the ip mask value to the priority of the request to determine whether it should contend for ar- bitration priority. arbitration priority is determined by the value of the iarb field in qsmcr. each module that generates interrupts must have a non-zero iarb value. arbitration is performed by means of serial contention between values stored in indi- vidual module iarb fields. when the qsm wins interrupt arbitration, it responds to the cpu32 interrupt acknowl- edge cycle by placing an interrupt vector number on the data bus. the vector number is used to calculate displacement into the cpu32 exception vector table. sci and qspi vector numbers are generated from the value in the qivr intv field. the values of bits intv[7:1] are the same for qspi and sci. the value of intv0 is supplied by the qsm when an interrupt request is made. intv0 = 0 for sci interrupt requests; intv0 = 1 for qspi interrupt requests. at reset, intv[7:0] is initialized to $0f, the uninitialized interrupt vector number. to enable interrupt-driven serial communication, a user-defined vector number must be written to qivr, and interrupt handler routines must be located at the addresses point- ed to by the corresponding vector. writes to intv0 have no effect. reads of intv0 return a value of one. refer to section 4 central processor unit and section 5 system in- tegration module for more information about exceptions and interrupts. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-4 user? manual 9.2.2 qsm pin control registers the qsm uses nine pins. eight of the pins can be used for serial communication or for parallel i/o. clearing a bit in the port qs pin assignment register (pqspar) assigns the corresponding pin to general-purpose i/o; setting a bit assigns the pin to the qspi. pqspar does not select i/o. in master mode, pqspar causes a bit to be assigned to the qspi when spe is set. in slave mode, the miso pin, if assigned to the qspi, remains under the control of the qspi, regardless of the spe bit. pqspar does not affect operation of the sci. the port qs data direction register (ddrqs) determines whether pins are inputs or outputs. clearing a bit makes the corresponding pin an input; setting a bit makes the pin an output. ddrqs affects both qspi function and i/o function. ddqs7 deter- mines the direction of the txd pin only when the sci transmitter is disabled. when the sci transmitter is enabled, the txd pin is an output. pqspar and ddrqs are 8-bit registers located at the same word address. table 9-1 is a summary of qsm pin func- tions. the port qs data register (portqs) latches i/o data. portqs writes drive pins de- fined as outputs. portqs reads return data present on the pins. to avoid driving un- defined data, first write portqs, then configure ddrqs. notes: 1. pqs2 is a digital i/o pin unless the spi is enabled (spe set in spcr1), in which case it becomes the qspi serial clock sck. 2. pqs7 is a digital i/o pin unless the sci transmitter is enabled (te set in sccr1), in which case it becomes the sci serial data output txd. table 9-1 effect of ddrqs on qsm pin function qsm pin mode ddrqs bit bit state pin function miso master ddqs0 0 serial data input to qspi 1 disables data input slave 0 disables data output 1 serial data output from qspi mosi master ddqs1 0 disables data output 1 serial data output from qspi slave 0 serial data input to qspi 1 disables data input sck 1 master ddqs2 clock output from qspi slave clock input to qspi pcs0/ss master ddqs3 0 assertion causes mode fault 1 chip-select output slave 0 qspi slave select input 1 disables slave select input pcs[1:3] master ddqs[4:6] 0 disables chip-select output 1 chip-select output slave 0 inactive 1 inactive txd 2 ddqs7 x serial data output from sci rxd none na serial data input to sci 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-5 9.3 queued serial peripheral interface the queued serial peripheral interface (qspi) is used to communicate with external devices through a synchronous serial bus. the qspi is fully compatible with spi sys- tems found on other motorola products, but has enhanced capabilities. the qspi can perform full duplex three-wire or half duplex two-wire transfers. a variety of transfer rates, clocking, and interrupt-driven communication options is available. figure 9-2 displays a block diagram of the qspi. figure 9-2 qspi block diagram qspi block control registers end queue pointer queue pointer status register delay counter comparator programmable logic array 80-byte qspi ram chip select command done 4 4 2 baud rate generator pcs[2:1] pcs0/ss miso mosi sck m s m s 8/16-bit shift register rx/tx data register msb lsb 4 4 queue control block control logic a d d r e s s r e g i s t e r 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-6 user? manual serial transfers of eight to sixteen can be specified. programmable transfer length sim- plifies interfacing to devices that require different data lengths. an inter-transfer delay of 17 to 8192 system clocks can be specified (default is 17 sys- tem clocks). programmable delay simplifies the interface to devices that require differ- ent delays between transfers. a dedicated 80-byte ram is used to store received data, data to be transmitted, and a queue of commands. the cpu32 can access these locations directly. this allows serial peripherals to be treated like memory-mapped parallel devices. the command queue allows the qspi to perform up to 16 serial transfers without cpu32 intervention. each queue entry contains all the information needed by the qspi to independently complete one serial transfer. a pointer identifies the queue location containing the data and command for the next serial transfer. normally, the pointer address is incremented after each serial transfer, but the cpu32 can change the pointer value at any time. support of multiple-tasks can be provided by segmenting the queue. the qspi has four peripheral chip-select pins. the chip-select signals simplify inter- facing by reducing cpu32 intervention. if the chip-select signals are externally decod- ed, 16 independent select signals can be generated. wrap-around mode allows continuous execution of queued commands. in wrap- around mode, newly received data replaces previously received data in the receive ram. wrap-around mode can simplify the interface with a/d converters by continu- ously updating conversion values stored in the ram. continuous transfer mode allows transfer of an uninterrupted bit stream. any number of bits in a range from 8 to 256 can be transferred without cpu32 intervention. longer transfers are possible, but minimal intervention is required to prevent loss of data. a standard delay of 17 system clocks is inserted between the transfer of each queue entry. 9.3.1 qspi registers the programmer? model for the qspi consists of the qsm global and pin control reg- isters, four qspi control registers (spcr[0:3]), the status register (spsr), and the 80- byte qspi ram. registers and ram can be read and written by the cpu32. refer to d.6 queued serial module for register bit and field definitions. 9.3.1.1 control registers control registers contain parameters for configuring the qspi and enabling various modes of operation. the cpu32 has read and write access to all control registers. the qsm has read access only to all bits except the spe bit in spcr1. control registers must be initialized before the qspi is enabled to insure defined operation. spcr1 must be written last because it contains the qspi enable bit (spe). writing a new value to any control register except spcr2 while the qspi is enabled disrupts operation. spcr2 is buffered. new spcr2 values become effective after completion of the current serial transfer. rewriting newqp in spcr2 causes execu- 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-7 tion to restart at the designated location. reads of spcr2 return the current value of the register, not of the buffer. writing the same value into any control register except spcr2 while the qspi is enabled has no effect on qspi operation. 9.3.1.2 status register spsr contains information concerning the current serial transmission. only the qspi can set the bits in this register. the cpu32 reads spsr to obtain qspi status infor- mation and writes spsr to clear status flags. 9.3.2 qspi ram the qspi contains an 80-byte block of dual-port access static ram that can be ac- cessed by both the qspi and the cpu32. the ram is divided into three segments: receive data ram, transmit data ram, and command data ram. receive data is in- formation received from a serial device external to the mcu. transmit data is informa- tion stored for transmission to an external device. command control data defines transfer parameters. refer to figure 9-3 , which shows ram organization. figure 9-3 qspi ram 9.3.2.1 receive ram data received by the qspi is stored in this segment. the cpu32 reads this segment to retrieve data from the qspi. data stored in the receive ram is right-justified. un- used bits in a receive queue entry are set to zero by the qspi upon completion of the individual queue entry. the cpu32 can access the data using byte, word, or long-word addressing. the cptqp value in spsr shows which queue entries have been executed. the cpu32 uses this information to determine which locations in receive ram contain val- id data before reading them. 9.3.2.2 transmit ram data that is to be transmitted by the qspi is stored in this segment and must be written to transmit ram in a right-justified format. the qspi cannot modify information in the transmit ram. the qspi copies the information to its data serializer for transmission. information remains in transmit ram until overwritten. qspi ram map receive ram transmit ram 500 51e 520 53e word 540 54f command ram byte word rr0 rr1 rr2 rrd rre rrf tr0 tr1 tr2 trd tre trf cr0 cr1 cr2 crd cre crf 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-8 user? manual 9.3.2.3 command ram command ram is used by the qspi in master mode. the cpu32 writes one byte of control information to this segment for each qspi command to be executed. the qspi cannot modify information in command ram. command ram consists of 16 bytes. each byte is divided into two fields. the periph- eral chip-select field enables peripherals for transfer. the command control field pro- vides transfer options. a maximum of 16 commands can be in the queue. queue execution by the qspi pro- ceeds from the address in newqp through the address in endqp (both of these fields are in spcr2). 9.3.3 qspi pins the qspi uses seven pins. these pins can be configured for general-purpose i/o when not needed for qspi application. table 9-2 shows qspi input and output pins and their functions. 9.3.4 qspi operation the qspi uses a dedicated 80-byte block of static ram accessible by both the qspi and the cpu32 to perform queued operations. the ram is divided into three seg- ments. there are 16 command bytes, 16 transmit data words, and 16 receive data words. qspi ram is organized so that one byte of command data, one word of trans- mit data, and one word of receive data correspond to one queue entry, $0?f. the cpu32 initiates qspi operation by setting up a queue of qspi commands in com- mand ram, writing transmit data into transmit ram, then enabling the qspi. the qspi executes the queued commands, sets a completion flag (spif), and then either interrupts the cpu32 or waits for intervention. there are four queue pointers. the cpu32 can access three of them through fields in qspi registers. the new queue pointer (newqp), contained in spcr2, points to the first command in the queue. an internal queue pointer points to the command currently being executed. the completed queue pointer (cptqp), contained in spsr, points to the last command executed. the end queue pointer (endqp), contained in spcr2, points to the final command in the queue. table 9-2 qspi pins pin names mnemonics mode function master in slave out miso master slave serial data input to qspi serial data output from qspi master out slave in mosi master slave serial data output from qspi serial data input to qspi serial clock sck master slave clock output from qspi clock input to qspi peripheral chip selects pcs[3:1] master select peripherals slave select pcs0/ss master master slave selects peripherals causes mode fault initiates serial transfer 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-9 the internal pointer is initialized to the same value as newqp. during normal opera- tion, the command pointed to by the internal pointer is executed, the value in the inter- nal pointer is copied into cptqp, the internal pointer is incremented, and then the sequence repeats. execution continues at the internal pointer address unless the newqp value is changed. after each command is executed, endqp and cptqp are compared. when a match occurs, the spif flag is set and the qspi stops and clears spe, unless wrap-around mode is enabled. at reset, newqp is initialized to $0. when the qspi is enabled, execution begins at queue address $0 unless another value has been written into newqp. endqp is ini- tialized to $0 at reset, but should be changed to show the last queue entry before the qspi is enabled. newqp and endqp can be written at any time. when newqp changes, the internal pointer value also changes. however, if newqp is written while a transfer is in progress, the transfer is completed normally. leaving newqp and endqp set to $0 transfers only the data in transmit ram location $0. 9.3.5 qspi operating modes the qspi operates in either master or slave mode. master mode is used when the mcu initiates data transfers. slave mode is used when an external device initiates transfers. switching between these modes is controlled by mstr in spcr0. before entering either mode, appropriate qsm and qspi registers must be initialized proper- ly. in master mode, the qspi executes a queue of commands defined by control bits in each command ram queue entry. chip-select pins are activated, data is transmitted from the transmit ram and received by the receive ram. in slave mode, operation proceeds in response to ss pin activation by an external spi bus master. operation is similar to master mode, but no peripheral chip selects are generated, and the number of bits transferred is controlled in a different manner. when the qspi is selected, it automatically executes the next queue transfer to exchange data with the external device correctly. although the qspi inherently supports multi-master operation, no special arbitration mechanism is provided. a mode fault flag (modf) indicates a request for spi master arbitration. system software must provide arbitration. note that unlike previous spi systems, mstr is not cleared by a mode fault being set nor are the qspi pin output drivers disabled. the qspi and associated output drivers must be disabled by clearing spe in spcr1. figure 9-4 shows qspi initialization. figures 9-5 through 9-9 show qspi master and slave operation. the cpu32 must initialize the qsm global and pin registers and the qspi control registers before enabling the qspi for either mode of operation (refer to 9.5 qsm initialization ). the command queue must be written before the qspi is en- abled for master mode operation. any data to be transmitted should be written into transmit ram before the qspi is enabled. during wrap-around operation, data for subsequent transmissions can be written at any time. 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-10 user? manual figure 9-4 flowchart of qspi initialization operation cpu32 initializes qsm global registers cpu32 initializes qspi control registers cpu32 initializes pqspar, portqs, and ddrqs cpu32 initializes qspi ram cpu32 enables qspi begin a2 initialization of qspi by the cpu32 mstr = 1 ? a1 y n qspi flow 1 (cpu32) in this order 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-11 figure 9-5 flowchart of qspi master operation (part 1) read command control and transmit data from ram using queue pointer address a1 working queue pointer changed to newqp is qspi disabled n y n execute serial transfer store received data in ram using queue pointer address b1 qspi cycle begins (master mode) y assert peripheral chip-select(s) is pcs to sck delay programmed n execute standard delay y execute programmed delay has newqp been written qspi flow 2 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-12 user? manual figure 9-6 flowchart of qspi master operation (part 2) is delay after transfer asserted y n execute programmed delay b1 write queue pointer to cptqp status bits c1 negate peripheral chip-select(s) y n is continue bit asserted execute standard delay qspi mstr2 flow 3 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-13 figure 9-7 flowchart of qspi master operation (part 3) assert spif status flag interrupt cpu32 is interrupt enable bit spifie asserted is wrap enable bit asserted y n reset working queue pointer to newqp or $0000 y disable qspi a1 n increment working queue pointer n is halt or freeze asserted a1 halt qspi and assert halta n is interrupt enable bit hmie asserted interrupt cpu32 y y n is halt or freeze asserted c1 y n y is this the last command in the queue qspi mstr3 flow4 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-14 user? manual figure 9-8 flowchart of qspi slave operation (part 1) read transmit data from ram using queue pointer address a2 queue pointer changed to newqp n y n write queue pointer to cptqp status bits store received data in ram using queue pointer address b2 qspi cycle begins (slave mode) y execute serial transfer when sck received n y is slave select pin asserted has newqp been written is qspi disabled qspi slv1 flow 5 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-15 figure 9-9 flowchart of qspi slave operation (part 2) assert spif status flag interrupt cpu32 is interrupt enable bit spifie asserted is wrap enable bit asserted y n reset working queue pointer to newqp or $0000 y disable qspi a2 n increment working queue pointer n is halt or freeze asserted a2 halt qspi and assert halta n is interrupt enable bit hmie asserted interrupt cpu32 y y n is halt or freeze asserted c2 y n y is this the last command in the queue qspi slv2 flow6 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-16 user? manual normally, the spi bus performs synchronous bidirectional transfers. the serial clock on the spi bus master supplies the clock signal sck to time the transfer of data. four possible combinations of clock phase and polarity can be specified by the cpha and cpol bits in spcr0. data is transferred with the most significant bit first. the number of bits transferred per command defaults to eight, but can be set to any value from eight to sixteen bits by writing a value into the bitse field in command ram. typically, spi bus outputs are not open-drain unless multiple spi masters are in the system. if needed, the womq bit in spcr0 can be set to provide wired-or, open- drain outputs. an external pull-up resistor should be used on each output line. womq affects all qspi pins regardless of whether they are assigned to the qspi or used as general-purpose i/o. 9.3.5.1 master mode setting the mstr bit in spcr0 selects master mode operation. in master mode, the qspi can initiate serial transfers, but cannot respond to externally initiated transfers. when the slave select input of a device configured for master mode is asserted, a mode fault occurs. before qspi operation begins, qsm register pqspar must be written to assign the necessary pins to the qspi. the pins necessary for master mode operation are miso and mosi, sck, and one or more of the chip-select pins. miso is used for serial data input in master mode, and mosi is used for serial data output. either or both may be necessary, depending on the particular application. sck is the serial clock output in master mode. the portqs data register must next be written with values that make the pqs2/sck and pqs[6:3]/pcs[3:0] outputs inactive when the qspi completes a series of trans- fers. pins allocated to the qspi by pqspar are controlled by portqs when the qspi is inactive. portqs i/o pins driven to states opposite those of the inactive qspi signals can generate glitches that momentarily enable or partially clock a slave device. thus, if a slave device operates with an inactive sck state of logic one (cpol = 1) and uses active low peripheral chip-select pcs0, the pqs[3:2] bits in portqs must be set to %11. if pqs[3:2] = %00, falling edges will appear on pqs2/sck and pqs3/pcs0 as the qspi relinquishes control of these pins and portqs drives them to logic zero from the inactive sck and pcs0 states of logic one. before master mode operation is initiated, qsm register ddrqs is written last to direct the data flow on the qspi pins used. configure the sck, mosi and appropriate chip-select pins pcs[3:0] as outputs. the miso pin must be configured as an input. after pins are assigned and configured, write appropriate data to the command queue. if data is to be transmitted, write the data to transmit ram. initialize the queue pointers as appropriate. data transfer is synchronized with the internally-generated serial clock sck. control bits, cpha and cpol, in spcr0, control clock phase and polarity. combinations of cpha and cpol determine upon which sck edge to drive outgoing data from the mosi pin and to latch incoming data from the miso pin. 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-17 baud rate is selected by writing a value from 2 to 255 into spbr[7:0] in spcr0. the qspi uses a modulus counter to derive sck baud rate from the mcu system clock. the following expressions apply to sck baud rate: or giving spbr[7:0] a value of zero or one disables the baud rate generator. sck is dis- abled and assumes its inactive state value. the dsck bit in each command ram byte inserts either a standard or user-specified delay from chip-select assertion until the leading edge of the serial clock. the dsckl field in spcr1 determines the length of the user-defined delay before the assertion of sck. the following expression determines the actual delay before sck: where dsckl[6:0] equals {1,2,3,..., 127}. when dsck equals zero, dsckl[6:0] is not used. instead, the pcs valid-to-sck transition is one-half the sck period. there are two transfer length options. the user can choose a default value of eight bits, or a programmed value of eight to sixteen bits, inclusive. the programmed value must be written into bits[3:0] in spcr0. the bitse bit in each command ram byte determines whether the default value (bitse = 0) or the bits value (bitse = 1) is used. table 9-3 shows bits[3:0] encoding. table 9-3 bits per transfer bits[3:0] bits per transfer 0000 16 0001 reserved 0010 reserved 0011 reserved 0100 reserved 0101 reserved 0110 reserved 0111 reserved 1000 8 1001 9 1010 10 1011 11 1100 12 1101 13 1110 14 1111 15 sck baud rate system clock 2 spbr[7:0] ------------------------------------- = spbr[7:0] system clock 2 sck baud rate desired ------------------------------------------------------------------------- - = pcs to sck delay dsckl[6:0] system clock ------------------------------------ = 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-18 user? manual delay after transfer can be used to provide a peripheral deselect interval. a delay can also be inserted between consecutive transfers to allow serial a/d converters to com- plete conversion. writing a value to dtl[7:0] in spcr1 specifies a delay period. the dt bit in each command ram byte determines whether the standard delay period (dt = 0) or the specified delay period (dt = 1) is used. the following expression is used to calculate the delay: where dtl equals {1, 2, 3,..., 255}. a zero value for dtl[7:0] causes a delay-after-transfer value of 8192/system clock. adequate delay between transfers must be specified for long data streams because the qspi requires time to load a transmit ram entry for transfer. receiving devices need at least the standard delay between successive transfers. if the system clock is operating at a slower rate, the delay between transfers must be increased proportion- ately. operation is initiated by setting the spe bit in spcr1. shortly after spe is set, the qspi executes the command at the command ram address pointed to by newqp. data at the pointer address in transmit ram is loaded into the data serializer and transmitted. data that is simultaneously received is stored at the pointer address in re- ceive ram. when the proper number of bits have been transferred, the qspi stores the working queue pointer value in cptqp, increments the working queue pointer, and loads the next data for transfer from transmit ram. the command pointed to by the incremented working queue pointer is executed next, unless a new value has been written to newqp. if a new queue pointer value is written while a transfer is in progress, that transfer is completed normally. when the cont bit in a command ram byte is set, pcs pins are continuously driven in specified states during and between transfers. if the chip-select pattern changes during or between transfers, the original pattern is driven until execution of the follow- ing transfer begins. when cont is cleared, the data in register portqs is driven be- tween transfers. the data in portqs must match the inactive states of sck and any peripheral chip-selects used. when the qspi reaches the end of the queue, it sets the spif flag. if the spifie bit in spcr2 is set, an interrupt request is generated when spif is asserted. at this point, the qspi clears spe and stops unless wrap-around mode is enabled. delay after transfer 32 dtl[7:0] system clock ------------------------------------ = standard delay after transfer 17 system clock ------------------------------------ = 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-19 9.3.5.2 master wrap-around mode wrap-around mode is enabled by setting the wren bit in spcr2. the queue can wrap to pointer address $0 or to the address pointed to by newqp, depending on the state of the wrto bit in spcr2. in wrap-around mode, the qspi cycles through the queue continuously, even while the qspi is requesting interrupt service. spe is not cleared when the last command in the queue is executed. new receive data overwrites previously received data in re- ceive ram. each time the end of the queue is reached, the spif flag is set. spif is not automatically reset. if interrupt-driven qspi service is used, the service routine must clear the spif bit to end the current interrupt request. additional interrupt re- quests during servicing can be prevented by clearing spifie, but spifie is buffered. clearing it does not end the current request. wrap-around mode is exited by clearing the wren bit or by setting the halt bit in spcr3. exiting wrap-around mode by clearing spe is not recommended, as clearing spe may abort a serial transfer in progress. the qspi sets spif, clears spe, and stops the first time it reaches the end of the queue after wren is cleared. after halt is set, the qspi finishes the current transfer, then stops executing commands. after the qspi stops, spe can be cleared. 9.3.5.3 slave mode clearing the mstr bit in spcr0 selects slave mode operation. in slave mode, the qspi is unable to initiate serial transfers. transfers are initiated by an external spi bus master. slave mode is typically used on a multi-master spi bus. only one device can be bus master (operate in master mode) at any given time. before qspi operation is initiated, qsm register pqspar must be written to assign necessary pins to the qspi. the pins necessary for slave mode operation are miso and mosi, sck, and pcs0/ss . miso is used for serial data output in slave mode, and mosi is used for serial data input. either or both may be necessary, depending on the particular application. sck is the serial clock input in slave mode. assertion of the ac- tive-low slave select signal ss initiates slave mode operation. before slave mode operation is initiated, ddrqs must be written to direct data flow on the qspi pins used. configure the mosi, sck and pcs0/ss pins as inputs. the miso pin must be configured as an output. after pins are assigned and configured, write data to be transmitted into transmit ram. command ram is not used in slave mode, and does not need to be initialized. set the queue pointers, as appropriate. when spe is set and mstr is clear, a low state on the slave select pcs0/ss pin be- gins slave mode operation at the address indicated by newqp. data that is received is stored at the pointer address in receive ram. data is simultaneously loaded into the data serializer from the pointer address in transmit ram and transmitted. transfer is synchronized with the externally generated sck. the cpha and cpol bits determine upon which sck edge to latch incoming data from the miso pin and to drive outgoing data from the mosi pin. 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-20 user? manual because the command ram is not used in slave mode, the cont, bitse, dt, dsck, and peripheral chip-select bits have no effect. the pcs0/ss pin is used only as an in- put. the spbr, dt and dsckl fields in spcr0 and spcr1 bits are not used in slave mode. the qspi drives neither the clock nor the chip-select pins and thus cannot con- trol clock rate or transfer delay. because the bitse option is not available in slave mode, the bits field in spcr0 specifies the number of bits to be transferred for all transfers in the queue. when the number of bits designated by bits[3:0] has been transferred, the qspi stores the working queue pointer value in cptqp, increments the working queue pointer, and loads new transmit data from transmit ram into the data serializer. the working queue pointer address is used the next time pcs0/ss is asserted, unless the cpu32 writes to newqp first. the qspi shifts one bit for each pulse of sck until the slave select input goes high. if ss goes high before the number of bits specified by the bits field is transferred, the qspi resumes operation at the same pointer address the next time ss is asserted. the maximum value that the bits field can have is 16. if more than 16 bits are trans- mitted before ss is negated, pointers are incremented and operation continues. the qspi transmits as many bits as it receives at each queue address, until the bits value is reached or ss is negated. ss does not need to go high between transfers as the qspi transfers data until reaching the end of the queue, whether ss remains low or is toggled between transfers. when the qspi reaches the end of the queue, it sets the spif flag. if the spifie bit in spcr2 is set, an interrupt request is generated when spif is asserted. at this point, the qspi clears spe and stops unless wrap-around mode is enabled. 9.3.5.4 slave wrap-around mode slave wrap-around mode is enabled by setting the wren bit in spcr2. the queue can wrap to pointer address $0 or to the address pointed to by newqp, depending on the state of the wrto bit in spcr2. slave wrap-around operation is identical to mas- ter wrap-around operation. 9.3.6 peripheral chip selects peripheral chip-select signals are used to select an external device for serial data transfer. chip-select signals are asserted when a command in the queue is executed. signals are asserted at a logic level corresponding to the value of the pcs[3:0] bits in each command byte. more than one chip-select signal can be asserted at a time, and more than one external device can be connected to each pcs pin, provided proper fanout is observed. pcs0 shares a pin with the slave select ss signal, which initiates slave mode serial transfer. if ss is taken low when the qspi is in master mode, a mode fault occurs. 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-21 to configure a peripheral chip-select, set the appropriate bit in pqspar, then config- ure the chip-select pin as an output by setting the appropriate bit in ddrqs. the value of the bit in portqs that corresponds to the chip-select pin determines the base state of the chip-select signal. if base state is zero, chip-select assertion must be active high (pcs bit in command ram must be set); if base state is one, assertion must be active low (pcs bit in command ram must be cleared). portqs bits are cleared during re- set. if no new data is written to portqs before pin assignment and configuration as an output, base state of chip-select signals is zero and chip-select pins are configured for active-high operation. 9.4 serial communication interface the serial communication interface (sci) communicates with external devices through an asynchronous serial bus. the sci uses a standard non-return to zero (nrz) trans- mission format. the sci is fully compatible with other motorola sci systems, such as those on m68hc11 and m68hc05 devices. figure 9-10 is a block diagram of the sci transmitter. figure 9-11 is a block diagram of the sci receiver. 9.4.1 sci registers the sci programming model includes the qsm global and pin control registers, and four sci registers. there are two sci control registers (sccr0 and sccr1), one sta- tus register (scsr), and one data register (scdr). refer to d.6 queued serial mod- ule for register bit and field definitions. 9.4.1.1 control registers sccr0 contains the baud rate selection field. baud rate must be set before the sci is enabled. this register can be read or written. sccr1 contains a number of sci configuration parameters, including transmitter and receiver enable bits, interrupt enable bits, and operating mode enable bits. this regis- ter can be read or written at any time. the sci can modify the rwu bit under certain circumstances. changing the value of sci control bits during a transfer may disrupt operation. before changing register values, allow the sci to complete the current transfer, then disable the receiver and transmitter. 336376umbook page 21 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-22 user? manual figure 9-10 sci transmitter block diagram loops woms ilt pt pe m wake tie tcie rie ilie te re rwu sbk transmitter control logic pin buffer and control h(8)76543210l 10 (11)-bit tx shift register ddrqs(d7) txd scdr tx buffer transfer tx buffer shift enable jam enable preamble?am 1's break?am 0's force pin direction (out) size 8/9 parity generator transmitter baud rate clock tc tdre sci rx requests sci interrupt request fe nf or idle rdrf tc tdre scsr status register pf internal data bus raf tie tcie sccr1 control register 1 0 15 15 0 start stop open drain output mode enable (write-only) 16/32 sci tx block 336376umbook page 22 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-23 figure 9-11 sci receiver block diagram 16/32 sci rx block 0 loops woms ilt pt pe m wake rie ilie te re rwu sbk tie tcie sccr1 control register 1 0 15 fe nf or idle rdrf tc tdre scsr status register pf raf 15 0 wake-up logic pin buffer rxd stop (8)76543210 10 (11)-bit rx shift register start msb all ones data recovery 16 parity detect receiver baud rate clock scdr rx buffer (read-only) sci tx requests sci interrupt request internal data bus l h 336376umbook page 23 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-24 user? manual 9.4.1.2 status register scsr contains flags that show sci operating conditions. these flags are cleared ei- ther by sci hardware or by reading scsr, then reading or writing scdr. a long-word read can consecutively access both scsr and scdr. this action clears receiver sta- tus flag bits that were set at the time of the read, but does not clear tdre or tc flags. if an internal sci signal for setting a status bit comes after reading the asserted status bits, but before reading or writing scdr, the newly set status bit is not cleared. scsr must be read again with the bit set, and scdr must be read or written before the sta- tus bit is cleared. reading either byte of scsr causes all 16 bits to be accessed, and any status bit al- ready set in either byte is cleared on a subsequent read or write of scdr. 9.4.1.3 data register scdr contains two data registers at the same address. the receive data register (rdr) is a read-only register that contains data received by the sci serial interface. data enters the receive serial shifter and is transferred to rdr. the transmit data reg- ister (tdr) is a write-only register that contains data to be transmitted. data is first writ- ten to tdr, then transferred to the transmit serial shifter, where additional format bits are added before transmission. r[7:0]/t[7:0] contain either the first eight data bits re- ceived when scdr is read, or the first eight data bits to be transmitted when scdr is written. r8/t8 are used when the sci is configured for 9-bit operation. when it is con- figured for 8-bit operation, they have no meaning or effect. 9.4.2 sci pins two unidirectional pins, txd (transmit data) and rxd (receive data), are associated with the sci. txd can be used by the sci or for general-purpose i/o. function is as- signed by the port qs pin assignment register (pqspar). the receive data (rxd) pin is dedicated to the sci. table 9-4 shows sci pin function. 9.4.3 sci operation sci operation can be polled by means of status flags in scsr, or interrupt-driven operation can be employed by the interrupt enable bits in sccr1. table 9-4 sci pins pin names mnemonics mode function receive data rxd receiver disabled receiver enabled not used serial data input to sci transmit data txd transmitter disabled transmitter enabled general-purpose i/o serial data output from sci 336376umbook page 24 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-25 9.4.3.1 definition of terms ?bit-time ?the time required to transmit or receive one bit of data, which is equal to one cycle of the baud frequency. ?start bit ?one bit-time of logic zero that indicates the beginning of a data frame. a start bit must begin with a one-to-zero transition and be preceded by at least three receive time samples of logic one. ?stop bit?one bit-time of logic one that indicates the end of a data frame. ?frame ?a complete unit of serial information. the sci can use 10-bit or 11-bit frames. ?data frame ?a start bit, a specified number of data or information bits, and at least one stop bit. ?idle frame ?a frame that consists of consecutive ones. an idle frame has no start bit. ?break frame ?a frame that consists of consecutive zeros. a break frame has no stop bits. 9.4.3.2 serial formats all data frames must have a start bit and at least one stop bit. receiving and transmit- ting devices must use the same data frame format. the sci provides hardware sup- port for both 10-bit and 11-bit frames. the m bit in sccr1 specifies the number of bits per frame. the most common data frame format for nrz serial interfaces is one start bit, eight data bits (lsb first), and one stop bit; a total of ten bits. the most common 11-bit data frame contains one start bit, eight data bits, a parity or control bit, and one stop bit. ten-bit and eleven-bit frames are shown in table 9-5 . 9.4.3.3 baud clock the sci baud rate is programmed by writing a 13-bit value to the scbr field in sci control register zero (sccr0). the baud rate is derived from the mcu system clock by a modulus counter. writing a value of zero to scbr[12:0] disables the baud rate generator. baud rate is calculated as follows: table 9-5 serial frame formats 10-bit frames start data parity/control stop 1 7? 1711 1 8? 11-bit frames start data parity/control stop 1712 1811 336376umbook page 25 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-26 user? manual or where scbr[12:0] is in the range {1, 2, 3, ..., 8191}. the sci receiver operates asynchronously. an internal clock is necessary to synchro- nize with an incoming data stream. the sci baud rate generator produces a receive time sampling clock with a frequency 16 times that of the sci baud rate. the sci de- termines the position of bit boundaries from transitions within the received waveform, and adjusts sampling points to the proper positions within the bit period. 9.4.3.4 parity checking the pt bit in sccr1 selects either even (pt = 0) or odd (pt = 1) parity. pt affects received and transmitted data. the pe bit in sccr1 determines whether parity check- ing is enabled (pe = 1) or disabled (pe = 0). when pe is set, the msb of data in a frame is used for the parity function. for transmitted data, a parity bit is generated for received data; the parity bit is checked. when parity checking is enabled, the pf bit in the sci status register (scsr) is set if a parity error is detected. enabling parity affects the number of data bits in a frame, which can in turn affect frame size. table 9-6 shows possible data and parity formats. 9.4.3.5 transmitter operation the transmitter consists of a serial shifter and a parallel data register (tdr) located in the sci data register (scdr). the serial shifter cannot be directly accessed by the cpu32. the transmitter is double-buffered, which means that data can be loaded into the tdr while other data is shifted out. the te bit in sccr1 enables (te = 1) and disables (te = 0) the transmitter. shifter output is connected to the txd pin while the transmitter is operating (te = 1, or te = 0 and transmission in progress). wired-or operation should be specified when more than one transmitter is used on the same sci bus. the woms bit in sccr1 determines whether txd is an open-drain (wired-or) output or a normal cmos output. an external pull-up resistor on txd is necessary for wired-or opera- tion. woms controls txd function whether the pin is used by the sci or as a general- purpose i/o pin. table 9-6 effect of parity checking on data size m pe result 0 0 8 data bits 0 1 7 data bits, 1 parity bit 1 0 9 data bits 1 1 8 data bits, 1 parity bit sci baud rate system clock 32 scbr[12:0] -------------------------------------------- = scbr[12:0] system clock 32 sci baud rate desired -------------------------------------------------------------------------- - = 336376umbook page 26 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-27 data to be transmitted is written to scdr, then transferred to the serial shifter. the transmit data register empty (tdre) flag in scsr shows the status of tdr. when tdre = 0, the tdr contains data that has not been transferred to the shifter. writing to scdr again overwrites the data. tdre is set when the data in the tdr is trans- ferred to the shifter. before new data can be written to the scdr, however, the pro- cessor must clear tdre by writing to scsr. if new data is written to the scdr without first clearing tdre, the data will not be transmitted. the transmission complete (tc) flag in scsr shows transmitter shifter state. when tc = 0, the shifter is busy. tc is set when all shifting operations are completed. tc is not automatically cleared. the processor must clear it by first reading scsr while tc is set, then writing new data to scdr. the state of the serial shifter is checked when the te bit is set. if tc = 1, an idle frame is transmitted as a preamble to the following data frame. if tc = 0, the current opera- tion continues until the final bit in the frame is sent, then the preamble is transmitted. the tc bit is set at the end of preamble transmission. the sbk bit in sccr1 is used to insert break frames in a transmission. a non-zero integer number of break frames is transmitted while sbk is set. break transmission begins when sbk is set, and ends with the transmission in progress at the time either sbk or te is cleared. if sbk is set while a transmission is in progress, that transmis- sion finishes normally before the break begins. to assure the minimum break time, toggle sbk quickly to one and back to zero. the tc bit is set at the end of break trans- mission. after break transmission, at least one bit-time of logic level one (mark idle) is transmitted to ensure that a subsequent start bit can be detected. if te remains set, after all pending idle, data and break frames are shifted out, tdre and tc are set and txd is held at logic level one (mark). when te is cleared, the transmitter is disabled after all pending idle; data and break frames are transmitted. the tc flag is set, and control of the txd pin reverts to pqspar and ddrqs. buffered data is not transmitted after te is cleared. to avoid losing data in the buffer, do not clear te until tdre is set. some serial communication systems require a mark on the txd pin even when the transmitter is disabled. configure the txd pin as an output, then write a one to pqs7. when the transmitter releases control of the txd pin, it reverts to driving a logic one output. to insert a delimiter between two messages, to place non-listening receivers in wake- up mode between transmissions, or to signal a retransmission by forcing an idle line, clear and then set te before data in the serial shifter has shifted out. the transmitter finishes the transmission, then sends a preamble. after the preamble is transmitted, if tdre is set, the transmitter will mark idle. otherwise, normal transmission of the next sequence will begin. both tdre and tc have associated interrupts. the interrupts are enabled by the transmit interrupt enable (tie) and transmission complete interrupt enable (tcie) bits in sccr1. service routines can load the last byte of data in a sequence into scdr, then terminate the transmission when a tdre interrupt occurs. 336376umbook page 27 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-28 user? manual 9.4.3.6 receiver operation the re bit in sccr1 enables (re = 1) and disables (re = 0) the receiver. the receiver contains a receive serial shifter and a parallel receive data register (rdr) lo- cated in the sci data register (scdr). the serial shifter cannot be directly accessed by the cpu32. the receiver is double-buffered, allowing data to be held in the rdr while other data is shifted in. receiver bit processor logic drives a state machine that determines the logic level for each bit-time. this state machine controls when the bit processor logic is to sample the rxd pin and also controls when data is to be passed to the receive serial shifter. a receive time clock is used to control sampling and synchronization. data is shifted into the receive serial shifter according to the most recent synchronization of the re- ceive time clock with the incoming data stream. from this point on, data movement is synchronized with the mcu system clock. operation of the receiver state machine is detailed in the qsm reference manual (qsmrm/ad). the number of bits shifted in by the receiver depends on the serial format. however, all frames must end with at least one stop bit. when the stop bit is received, the frame is considered to be complete, and the received data in the serial shifter is transferred to the rdr. the receiver data register flag (rdrf) is set when the data is transferred. noise errors, parity errors, and framing errors can be detected while a data stream is being received. although error conditions are detected as bits are received, the noise flag (nf), the parity flag (pf), and the framing error (fe) flag in scsr are not set until data is transferred from the serial shifter to the rdr. rdrf must be cleared before the next transfer from the shifter can take place. if rdrf is set when the shifter is full, transfers are inhibited and the overrun error (or) flag in scsr is set. or indicates that the rdr needs to be serviced faster. when or is set, the data in the rdr is preserved, but the data in the serial shifter is lost. be- cause framing, noise, and parity errors are detected while data is in the serial shifter, fe, nf, and pf cannot occur at the same time as or. when the cpu32 reads scsr and scdr in sequence, it acquires status and data, and also clears the status flags. reading scsr acquires status and arms the clearing mechanism. reading scdr acquires data and clears scsr. when rie in sccr1 is set, an interrupt request is generated whenever rdrf is set. because receiver status flags are set at the same time as rdrf, they do not have separate interrupt enables. 9.4.3.7 idle-line detection during a typical serial transmission, frames are transmitted isochronally and no idle time occurs between frames. even when all the data bits in a frame are logic ones, the start bit provides one logic zero bit-time during the frame. an idle line is a sequence of contiguous ones equal to the current frame size. frame size is determined by the state of the m bit in sccr1. 336376umbook page 28 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-29 the sci receiver has both short and long idle-line detection capability. idle-line detec- tion is always enabled. the idle line type (ilt) bit in sccr1 determines which type of detection is used. when an idle line condition is detected, the idle flag in scsr is set. for short idle-line detection, the receiver bit processor counts contiguous logic one bit- times whenever they occur. short detection provides the earliest possible recognition of an idle line condition, because the stop bit and contiguous logic ones before and after it are counted. for long idle-line detection, the receiver counts logic ones after the stop bit is received. only a complete idle frame causes the idle flag to be set. in some applications, software overhead can cause a bit-time of logic level one to oc- cur between frames. this bit-time does not affect content, but if it occurs after a frame of ones when short detection is enabled, the receiver flags an idle line. when the ilie bit in sccr1 is set, an interrupt request is generated when the idle flag is set. the flag is cleared by reading scsr and scdr in sequence. idle is not set again until after at least one frame has been received (rdrf = 1). this prevents an extended idle interval from causing more than one interrupt. 9.4.3.8 receiver wake-up the receiver wake-up function allows a transmitting device to direct a transmission to a single receiver or to a group of receivers by sending an address frame at the start of a message. hardware activates each receiver in a system under certain conditions. resident software must process address information and enable or disable receiver operation. a receiver is placed in wake-up mode by setting the rwu bit in sccr1. while rwu is set, receiver status flags and interrupts are disabled. although the cpu32 can clear rwu, it is normally cleared by hardware during wake-up. the wake bit in sccr1 determines which type of wake-up is used. when wake = 0, idle-line wake-up is selected. when wake = 1, address-mark wake-up is selected. both types require a software-based device addressing and recognition scheme. idle-line wake-up allows a receiver to sleep until an idle line is detected. when an idle- line is detected, the receiver clears rwu and wakes up. the receiver waits for the first frame of the next transmission. the byte is received normally, transferred to the rdr, and the rdrf flag is set. if software does not recognize the address, it can set rwu and put the receiver back to sleep. for idle-line wake-up to work, there must be a min- imum of one frame of idle line between transmissions. there must be no idle time be- tween frames within a transmission. address-mark wake-up uses a special frame format to wake up the receiver. when the msb of an address-mark frame is set, that frame contains address information. the first frame of each transmission must be an address frame. when the msb of a frame is set, the receiver clears rwu and wakes up. the byte is received normally, trans- ferred to the rdr, and the rdrf flag is set. if software does not recognize the ad- dress, it can set rwu and put the receiver back to sleep. address-mark wake-up allows idle time between frames and eliminates idle time between transmissions. how- ever, there is a loss of efficiency because of an additional bit-time per frame. 336376umbook page 29 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-30 user? manual 9.4.3.9 internal loop the loops bit in sccr1 controls a feedback path in the data serial shifter. when loops is set, the sci transmitter output is fed back into the receive serial shifter. txd is asserted (idle line). both transmitter and receiver must be enabled before entering loop mode. 9.5 qsm initialization after reset, the qsm remains in an idle state until initialized. a general guide for initialization follows. a. global 1. configuration qsmcr a.write an interrupt arbitration priority value into the iarb field. b. clear the freeze and/or stop bits for normal operation. 2. configure qivr and qilr a. write qspi/sci interrupt vector number into qivr. b. write qspi (ilspi) and sci (ilsci) interrupt priorities into qilr. 3. configure portqs and ddrqs a. write a data word to portqs. b. set the direction of qsm pins used for i/o by writing to ddrqs. 4. assign pin functions by writing to the pin assignment register pqspar b. queued serial peripheral interface 1. write appropriate values to qspi command ram and transmit ram. 2. set up the spcr0 a. set the bit in with the br field. b. determine clock phase (cpha), and clock polarity (cpol). c. determine number of bits to be transferred in a serial operation (bits[3:0]). d. select master or slave operating mode (mstr). e. enable or disable wired-or operation (womq). 3. set up spcr1 a. establish a delay following serial transfer by writing to the dtl field. b. establish a delay before serial transfer by writing to the dsckl field. 4. set up spcr2 a. write an initial queue pointer value into the newqp field. b. write a final queue pointer value into the endqp field. c. enable or disable queue wrap-around (wren). d. set wrap-around address if enabled (wrto). e. enable or disable qspi interrupt (spifie). 5. set up spcr3 a. enable or disable halt at end of queue (halt). b. enable or disable halt and mode fault interrupts (hmie). c. enable or disable loopback (loopq). 6. to enable the qspi, set the spe bit in spcr1. c. serial communication interface 1. set up sccr0 a. set the baud with the scbr field. 336376umbook page 30 friday, november 15, 1996 2:09 pm
MC68336/376 queued serial module motorola user? manual 9-31 2. set up sccr1 a. select serial mode (m) b. enable use (pe) and type (pt) of parity check. c. select use (rwu) and type (wake) of receiver wake-up. d. enable idle-line detection (ilt) and interrupt (ilie). e. enable or disable wired-or operation (woms). f. enable or disable break transmission (sbk). 3. to receive: a. set the receiver (re) and receiver interrupt (rie) bits in sccr1. 4. to transmit: a. set transmitter (te) and transmitter interrupt (tie) bits in sccr1. b. clear the tdre and tc flags by reading scsr and writing data to scdr. 336376umbook page 31 friday, november 15, 1996 2:09 pm
motorola queued serial module MC68336/376 9-32 user? manual 336376umbook page 32 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-1 section 8 queued analog-to-digital converter module this section is an overview of the queued analog-to-digital converter (qadc) module. refer to the qadc reference manual (qadcrm/ad) for a comprehensive discussion of qadc capabilities. 8.1 general the qadc consists of an analog front-end and a digital control subsystem, which includes an intermodule bus (imb) interface block. refer to figure 8-1 . the analog section includes input pins, an analog multiplexer, and two sample and hold analog circuits. the analog conversion is performed by the digital-to-analog converter (dac) resistor-capacitor array and a high-gain comparator. the digital control section contains the conversion sequencing logic, channel selection logic, and a successive approximation register (sar). also included are the periodic/ interval timer, control and status registers, the conversion command word (ccw) table ram, and the result word table ram. figure 8-1 qadc block diagram qadc block queue of 10-bit conversion command words (ccw), 40 words intermodule bus interface digital control 10-bit result table, 40 words 10-bit to 16-bit result alignment 10-bit analog to digital converter analog input multiplexer and digital pin functions external triggers external mux address up to 16 analog input pins reference inputs analog power inputs 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-2 user? manual 8.2 qadc address map the qadc occupies 512 bytes of address space. nine words are control, port, and status registers, 40 words are the ccw table, and 120 words are the result word table because 40 result registers can be read in three data alignment formats. the remain- ing words are reserved for expansion. refer to d.5 qadc module for information con- cerning the qadc address map. 8.3 qadc registers the qadc has three global registers for configuring module operation: the module configuration register (qadcmcr), the interrupt register (qadcint), and a test reg- ister (qadctest). the global registers are always defined to be in supervisor data space. the cpu32 allows software to establish the global registers in supervisor data space and the remaining registers and tables in user space. all qadc analog channel/port pins that are not used for analog input channels can be used as digital port pins. port values are read/written by accessing the port a and b data registers (portqa and portqb). port a pins are specified as inputs or outputs by programming the port data direction register (ddrqa). port b is an input only port. the four remaining control registers configure the operation of the queuing mecha- nism, and provide a means of monitoring the operation of the qadc. control register 0 (qacr0) contains hardware configuration information. control register 1 (qacr1) is associated with queue 1, and control register 2 (qacr2) is associated with queue 2. the status register (qasr) provides visibility on the status of each queue and the particular conversion that is in progress. following the register block in the address map is the ccw table. there are 40 words to hold the desired analog conversion sequences. each ccw is a 16-bit word, with ten implemented bits in four fields. refer to d.5.8 conversion command word table for more information. the final block of address space belongs to the result word table, which appears in three places in the memory map. each result word table location holds one 10-bit con- version value. the software selects one of three data formats, which map the 10-bit result onto the 16-bit data bus by reading the address which produces the desired alignment. the first address block presents the result data in right justified format, the second block is presented in left justified signed format, and the third is presented in left justified unsigned format. refer to d.5.9 result word table for more information. 8.4 qadc pin functions the qadc uses a maximum of 21 external pins. there are 16 channel/port pins that can support up to 41 channels when external multiplexing is used (including internal channels). all of the channel pins can also be used as general-purpose digital port pins. in addition, there are also two analog reference pins, two analog submodule power pins, and one v ss pin for the open drain output drivers on port a. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-3 the qadc allows external trigger inputs and the multiplexer outputs to be combined onto some of the channel pins. all of the channel pins are used for at least two func- tions, depending on the modes in use. the following paragraphs describe qadc pin functions. figure 8-2 shows the qadc module pins. figure 8-2 qadc input and output signals 8.4.1 port a pin functions the eight port a pins can be used as analog inputs, or as a bidirectional 8-bit digital input/output port. refer to the following paragraphs for more information. qadc pinout an52/ma0/pqa0 an53/ma1/pqa1 an54/ma2/pqa2 an55/etrig1/pqa3 an56/etrig2/pqa4 an57/pqa5 an58/pqa6 an59/pqa7 an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 digital results and control analog converter analog multiplexer port a analog inputs, ext trigger inputs, ext mux address outputs, digital i/o * port b analog inputs, ext mux inputs, digital inputs v ss v dd v ss qadc v dda v ssa v rl v rh output driver ground analog references analog power & ground digital power (shared w/ other modules) port a * port b * port a pins incorporate open drain pull down drivers. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-4 user? manual 8.4.1.1 port a analog input pins when used as analog inputs, the eight port a pins are referred to as an[59:52]. due to the digital output drivers associated with port a, the analog characteristics of port a are different from those of port b. all of the analog signal input pins may be used for at least one other purpose. 8.4.1.2 port a digital input/output pins port a pins are referred to as pqa[7:0] when used as a bidirectional 8-bit digital input/ output port. these eight pins may be used for general-purpose digital input signals or digital open drain pull-down output signals. port a pins are connected to a digital input synchronizer during reads and may be used as general purpose digital inputs. each port a pin is configured as an input or output by programming the port data direction register (ddrqa). digital input signal states are read from the portqa data register when ddrqa specifies that the pins are inputs. digital data in portqa is driven onto the port a pins when the corresponding bits in ddrqa specify outputs. refer to d.5.5 port data direction register for more information. since the outputs are open drain drivers (so as to minimize the effects to the analog function of the pins), external pull-up resistors must be used when port a pins are used to drive another de- vice. 8.4.2 port b pin functions the eight port b pins can be used as analog inputs, or as an 8-bit digital input only port. refer to the following paragraphs for more information. 8.4.2.1 port b analog input pins when used as analog inputs, the eight port b pins are referred to as an[51:48]/ an[3:0]. since port b functions as analog and digital input only, the analog character- istics are different from those of port a. refer to appendix a electrical char- acteristics for more information on analog signal characteristics. all of the analog signal input pins may be used for at least one other purpose. 8.4.2.2 port b digital input pins port b pins are referred to as pqb[7:0] when used as an 8-bit digital input only port. in addition to functioning as analog input pins, the port b pins are also connected to the input of a synchronizer during reads and may be used as general-purpose digital inputs. since port b pins are input only, there is no associated data direction register. digital input signal states are read from the portqb data register. refer to d.5.5 port data direction register for more information. 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-5 8.4.3 external trigger input pins the qadc has two external trigger pins (etrig[2:1]). the external trigger pins share two multifunction port a pins (pqa[4:3]), which are normally used as analog channel input pins. each of the two external trigger pins is associated with one of the scan queues. when a queue is in external trigger mode, the corresponding external trigger pin is configured as a digital input and the software programmed input/output direction for that pin is ignored. refer to d.5.5 port data direction register for more informa- tion. 8.4.4 multiplexed address output pins in non-multiplexed mode, the 16 channel pins are connected to an internal multiplexer which routes the analog signals into the a/d converter. in externally multiplexed mode, the qadc allows automatic channel selection through up to four external 1-of-8 multiplexer chips. the qadc provides a 3-bit multiplexed ad- dress output to the external mux chips to allow selection of one of eight inputs. the multiplexed address output signals ma[2:0] can be used as multiplex address output bits or as general-purpose i/o. ma[2:0] are used as the address inputs for up to four 1-of-8 multiplexer chips (for ex- ample, the mc14051 and the mc74hc4051). since ma[2:0] are digital outputs in mul- tiplexed mode, the software programmed input/output direction for these pins in ddrqa is ignored. 8.4.5 multiplexed analog input pins in externally multiplexed mode, four of the port b pins are redefined to each represent a group of eight input channels. refer to table 8-1 . the analog output of each external multiplexer chip is connected to one of the an[w, x, y, z] inputs in order to convert a channel selected by the ma[2:0] multiplexed ad- dress outputs. 8.4.6 voltage reference pins v rh and v rl are the dedicated input pins for the high and low reference voltages. sep- arating the reference inputs from the power supply pins allows for additional external filtering, which increases reference voltage precision and stability, and subsequently contributes to a higher degree of conversion accuracy. refer to tables a-11 and a- 12 for more information. table 8-1 multiplexed analog input channels multiplexed analog input channels anw even numbered channels from 0 to 14 anx odd numbered channels from 1 to 15 any even channels from 16 to 30 anz odd channels from 17 to 31 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-6 user? manual 8.4.7 dedicated analog supply pins v dda and v ssa pins supply power to the analog subsystems of the qadc module. dedicated power is required to isolate the sensitive analog circuitry from the normal levels of noise present on the digital power supply. refer to tables a-11 and a-12 for more information. 8.4.8 external digital supply pin each port a pin includes a digital open drain output driver, an analog input signal path, and a digital input synchronizer. the v ss pin provides the ground level for the drivers on the port a pins. since the qadc output pins have open drain type drivers, a dedi- cated v dd pin is not needed. 8.4.9 digital supply pins v dd and v ss provide the power for the digital portions of the qadc, and for all other digital mcu modules. 8.5 qadc bus interface the qadc can respond to byte, word, and long word accesses, however, coherency is not provided for accesses that require more than one bus cycle. for example, if a long word read of two consecutive result registers is initiated, the qadc could change one of the result registers between the bus cycles required for each register read. all read and write accesses that require more than one 16-bit access to complete occur as two or more independent bus cycles. normal reads from and writes to the qadc require two clock cycles. however, if the cpu32 tries to access locations that are also accessible to the qadc while the qadc is accessing them, the bus cycle will require additional clock cycles. the qadc may insert from one to four wait states in the process of a cpu32 read from or write to such a location. 8.6 module configuration the qadc module configuration register (qadcmcr) defines freeze and stop mode operation, supervisor space access, and interrupt arbitration priority. unimplemented bits read zero and writes have no effect. qadcmcr is typically written once when software initializes the qadc, and not changed thereafter. refer to d.5.1 qadc mod- ule configuration register for register and bit descriptions. 8.6.1 low-power stop mode when the stop bit in qadcmcr is set, the clock signal to the a/d converter is dis- abled, effectively turning off the analog circuitry. this results in a static, low power con- sumption, idle condition. low-power stop mode aborts any conversion sequence in progress. because the bias currents to the analog circuits are turned off in low-power stop mode, the qadc requires some recovery time (t sr in appendix a electri- cal characteristics ) to stabilize the analog circuits after the stop bit is cleared. 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-7 in the low-power stop mode, qadcmcr, the interrupt register (qadcint), and the test register (qadctest) are not reset and fully accessible. the data direction regis- ter (ddrqa) and port data registers (portqa and portqb) are not reset and are read-only accessible. control register 0 (qacr0), control register 1 (qacr1), control register 2 (qacr2), and status register (qasr) are reset and are read-only accessi- ble. the ccw table and result table are not reset and not accessible. in addition, the qadc clock (qclk) and the periodic/interval timer are held in reset during low-power stop mode. if the stop bit is clear, low-power stop mode is disabled. refer to d.5.1 qadc mod- ule configuration register for more information. 8.6.2 freeze mode the qadc enters freeze mode when background debug mode is enabled and a breakpoint is processed. this is indicated by assertion of the freeze line on the imb. the frz bit in qadcmcr determines whether or not the qadc responds to an imb freeze assertion. freeze mode is useful when debugging an application. when the imb freeze line is asserted and the frz bit is set, the qadc finishes any conversion in progress and then freezes. depending on when the freeze is assert- ed, there are three possible queue freeze scenarios: ?when a queue is not executing, the qadc freezes immediately. ?when a queue is executing, the qadc completes the current conversion and then freezes. ?if during the execution of the current conversion, the queue operating mode for the active queue is changed, or a queue 2 abort occurs, the qadc freezes immediately. when the qadc enters the freeze mode while a queue is active, the current ccw location of the queue pointer is saved. in freeze mode, the analog logic is held in reset and is not clocked. although qclk is unaffected, the periodic/interval timer is held in reset. external trigger events that oc- cur during freeze mode are not recorded. the cpu32 may continue to access all qadc registers, the ccw table, and the result table. although the qadc saves a pointer to the next ccw in the current queue, software can force the qadc to execute a different ccw by writing new queue operating modes before normal operation resumes. the qadc looks at the queue operating modes, the current queue pointer, and any pending trigger events to decide which ccw to execute. if the frz bit is clear, assertion of the imb freeze line is ignored. refer to d.5.1 qadc module configuration register for more information. 8.6.3 supervisor/unrestricted address space the qadc memory map is divided into two segments: supervisor-only data space and assignable data space. access to supervisor-only data space is permitted only when the cpu32 is operating in supervisor mode. assignable data space can have either restricted to supervisor-only data space access or unrestricted supervisor and user 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-8 user? manual data space accesses. the supv bit in qadcmcr designates the assignable space as supervisor or unrestricted. attempts to read supervisor-only data space when the cpu32 is not in supervisor mode causes a value of $0000 to be returned. attempts to read assignable data space when the cpu32 is not in supervisor mode and when the space is programmed as supervisor space, causes a value of $ffff to be returned. attempts to write supervi- sor-only or supervisor-assigned data space when the cpu32 is in user mode has no effect. the supervisor-only data space segment contains the qadc global registers, which include qadcmcr, qadctest, and qadcint. the supervisor/unrestricted space designation for the ccw table, the result word table, and the remaining qadc registers is programmable. refer to d.5.1 qadc module configuration register for more information. 8.6.4 interrupt arbitration priority each module that can request interrupts, including the qadc, has an interrupt arbitra- tion number (iarb) field in its module configuration register. each iarb field must have a different non-zero value. during an interrupt acknowledge cycle, iarb permits arbitration among simultaneous interrupts of the same priority level. the reset value of iarb in the qadcmcr is $0. initialization software must set the iarb field to a non-zero value in order for qadc interrupts to be arbitrated. refer to d.5.1 qadc module configuration register for more information. 8.7 test register the qadc test register (qadctest) is used only during factory testing of the mcu. 8.8 general-purpose i/o port operation qadc port pins, when used as general-purpose input, are conditioned by a synchro- nizer with an enable feature. the synchronizer is not enabled until the qadc decodes an imb bus cycle which addresses the port data register to minimize the high-current effect of mid-level signals on the inputs used for analog signals. digital input signals must meet the input low voltage (v il ) or input high voltage (v ih ) specifications in ap- pendix a electrical characteristics . if an analog input pin does not meet the digital input pin specifications when a digital port read operation occurs, an inde- terminate state is read. during a port data register read, the actual value of the pin is reported when its corre- sponding bit in the data direction register defines the pin to be an input (port a only). when the data direction bit specifies the pin to be an output, the content of the port data register is read. by reading the latch which drives the output pin, software instruc- tions that read data, modify it, and write the result, like bit manipulation instructions, work correctly. 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-9 there are two special cases to consider for digital i/o port operation. when the mux (externally multiplexed) bit is set in qacr0, the data direction register settings are ig- nored for the bits corresponding to pqa[2:0], the three multiplexed address ma[2:0] output pins. the ma[2:0] pins are forced to be digital outputs, regardless of the data direction setting, and the multiplexed address outputs are driven. the data returned during a port data register read is the value of the multiplexed address latches which drive ma[2:0], regardless of the data direction setting. similarly, when an external trigger queue operating mode is selected, the data direc- tion register setting for the corresponding pins, pqa3 and/or pqa4, is ignored. the port pins are forced to be digital inputs for etrig1 and/or etrig2. the data read during a port data register read is the actual value of the pin, regardless of the data direction register setting. 8.8.1 port data register qadc ports a and b are accessed through two 8-bit port data registers (portqa and portqb). port a pins are referred to as pqa[7:0] when used as an 8-bit input/output port. port a can also be used for analog inputs an[59:52], external trigger inputs etrig[2:1], and external multiplexer address outputs ma[2:0]. port b pins are referred to as pqb[7:0] when used as an 8-bit input-only digital port. port b can also be used for non-multiplexed an[51:48]/an[3:0] and multiplexed anz, any, anx, anw analog inputs. portqa and portqb are unaffected by reset. refer to d.5.4 port a/b data reg- ister for register and bit descriptions. 8.8.2 port data direction register the port data direction register (ddrqa) is associated with the port a digital i/o pins. these bidirectional pins have somewhat higher leakage and capacitance specifica- tions. refer to appendix a electrical characteristics for more informa- tion. any bit in this register set to one configures the corresponding pin as an output. any bit in this register cleared to zero configures the corresponding pin as an input. soft- ware is responsible for ensuring that ddrqa bits are not set to one on pins used for analog inputs. when a ddrqa bit is set to one and the pin is selected for analog conversion, the voltage sampled is that of the output digital driver as influenced by the load. note caution should be exercised when mixing digital and analog inputs. this should be minimized as much as possible. input pin rise and fall times should be as large as possible to minimize ac coupling effects. since port b is input-only, a data direction register is not needed. read operations on the reserved bits in ddrqa return zeros, and writes have no effect. refer to d.5.5 port data direction register for register and bit descriptions. 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-10 user? manual 8.9 external multiplexing operation external multiplexers concentrate a number of analog signals onto a few inputs to the analog converter. this is helpful in applications that need to convert more analog sig- nals than the a/d converter can normally provide. external multiplexing also puts the multiplexer closer to the signal source. this minimizes the number of analog signals that need to be shielded due to the close proximity of noisy, high speed digital signals near the mcu. the qadc can use from one to four external multiplexers to expand the number of analog signals that may be converted. up to 32 analog channels can be converted through external multiplexer selection. the externally multiplexed channels are auto- matically selected from the channel field of the conversion command word (ccw) ta- ble, the same as internally multiplexed channels. all of the automatic queue features are available for externally and internally multi- plexed channels. the software selects externally multiplexed mode by setting the mux bit in qacr0. figure 8-3 shows the maximum configuration of four external multiplexers connected to the qadc. the external multiplexers select one of eight analog inputs and connect it to one analog output, which becomes an input to the qadc. the qadc provides three multiplexed address signals (ma[2:0]), to select one of eight inputs. these outputs are connected to all four multiplexers. the analog output of each multiplexer is each connected to one of four separate qadc inputs ?anw, anx, any, and anz. 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-11 figure 8-3 example of external multiplexing when the external multiplexed mode is selected, the qadc automatically creates the ma[2:0] open drain output signals from the channel number in each ccw. the qadc also converts the proper input channel (anw, anx, any, and anz) by interpreting the ccw channel number. as a result, up to 32 externally multiplexed channels appear to the conversion queues as directly connected signals. software simply puts the chan- nel number of an externally multiplexed channel into a ccw. figure 8-3 shows that ma[2:0] may also be analog or digital input pins. when external multiplexing is selected, none of the ma[2:0] pins can be used for analog or digital in- puts. they become multiplexed address outputs. qadc ext mux conn an52/ma0/pqa0 * an53/ma1/pqa1 * an54/ma2/pqa2 * an55/etrig1/pqa3 * an56/etrig2/pqa4 * an57/pqa5 * an58/pqa6 * an59/pqa7 * an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 digital results and control analog converter analog multiplexer v sse qadc v dda v ssa v rl v rh mux an0 an2 an4 an6 an8 an10 an12 an14 mux an1 an3 an5 an7 an9 an11 an13 an15 mux an16 an18 an20 an22 an24 an26 an28 an30 mux an17 an19 an21 an23 an25 an27 an29 an31 analog power analog references external triggers port b port a * * port a pins incorporate open drain pull down drivers. 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-12 user? manual 8.10 analog input channels the number of available analog channels varies, depending on whether or not exter- nal multiplexing is used. a maximum of 16 analog channels are supported by the in- ternal multiplexing circuitry of the converter. table 8-2 shows the total number of analog input channels supported with zero to four external multiplexers. 8.11 analog subsystem the qadc analog subsystem includes a front-end analog multiplexer, a digital to an- alog converter (dac) array, a comparator, and a successive approximation register (sar). the analog subsystem path runs from the input pins through the input multiplexing cir- cuitry, into the dac array, and through the analog comparator. the output of the com- parator feeds into the sar and is considered the boundary between the analog and digital subsystems of the qadc. figure 8-4 shows a block diagram of the qadc analog submodule. notes: 1. the above assumes that the external trigger inputs are shared with two analog input pins. 2. when external multiplexing is used, three input channels become multiplexed address out- puts, and for each external multiplexer chip, one input channel becomes a multiplexed ana- log input. table 8-2 analog input channels number of analog input channels available directly connected + external multiplexed = total channels 1 , 2 no external mux chips one external mux chip two external mux chips three external mux chips four external mux chips 16 12 + 8 = 20 11 + 16 = 27 10 + 24 = 34 9 + 32 = 41 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-13 figure 8-4 qadc module block diagram 8.11.1 conversion cycle times total conversion time is made up of initial sample time, transfer time, final sample time, and resolution time. initial sample time refers to the time during which the selected in- put channel is connected to the sample capacitor at the input of the sample buffer am- plifier. during the transfer period, the sample capacitor is disconnected from the multiplexer, and the stored voltage is buffered and transferred to the rc dac array. during the final sampling period, the sample capacitor and amplifier are bypassed, and the multiplexer input charges the rc dac array directly. during the resolution pe- riod, the voltage in the rc dac array is converted to a digital value and stored in the sar. initial sample time is fixed at two qclks and the transfer time at four qclks. final sample time can be 2, 4, 8, or 16 adc clock cycles, depending on the value of the ist field in the ccw. resolution time is ten cycles. transfer and resolution require a minimum of 18 qclk clocks (8.6 m s with a 2.1 mhz qclk). if the maximum final sample time period of 16 qclks is selected, the total conversion time is 15.2 m s with a 2.1 mhz qclk. clock pqa7 pqa0 pqb7 pqb0 chan. mux vdda vssa sample/ mux 4: 1 10-bit compar- charge successive port pqa port pqb result bus periodic sample imb address addr data clock external alignment decode input i/o control registers and control logic timer timer 16: 2 triggers ator rc-dac vrh vrl address decode result table ccw table 10-bit, 10-bit, pump and bias 40-word ram 40-word ram dac hold sample/ hold prescaler inter- module bus inter- face approximation register dummy qadc detail block 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-14 user? manual figure 8-5 illustrates the timing for conversions. this diagram assumes a final sampling period of two qclks. figure 8-5 conversion timing 8.11.1.1 amplifier bypass mode conversion timing if the amplifier bypass mode is enabled for a conversion by setting the amplifier bypass (byp) bit in the ccw, the timing changes to that shown in figure 8-6 . the initial sam- ple time and the transfer time are eliminated, reducing the potential conversion time by six qclks. however, due to internal rc effects, a minimum final sample time of four qclks must be allowed. this results in a savings of four qclks. when using the bypass mode, the external circuit should be of low source impedance, typically less than 10 k w . also, the loading effects of the external circuitry by the qadc need to be considered, since the benefits of the sample amplifier are not present. initial sample time transfer time final sample time resolution time sample and transfer time successive approximation resolution sequence 2 cycles 4 cycles n cycles: 10 cycles qclk (2, 4, 8, 16) qadc conversion tim 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-15 figure 8-6 bypass mode conversion timing 8.11.2 front-end analog multiplexer the internal multiplexer selects one of the 16 analog input pins or one of three special internal reference channels for conversion. the following are the three special chan- nels: ?v rh ?reference voltage high ?v rl ?reference voltage low ?v dda /2 ?mid-analog supply voltage the selected input is connected to one side of the dac capacitor array. the other side of the dac array is connected to the comparator input. the multiplexer also includes positive and negative stress protection circuitry, which prevents other channels from affecting the current conversion when voltage levels are applied to the other channels. refer to appendix a electrical characteristics for specific voltage level limits. 8.11.3 digital to analog converter array the digital to analog converter (dac) array consists of binary-weighted capacitors and a resistor-divider chain. the array serves two purposes: ?the array holds the sampled input voltage during conversion. ?the resistor-capacitor array provides the mechanism for the successive approx- imation a/d conversion. resolution begins with the msb and works down to the lsb. the switching sequence is controlled by the digital logic. sample time resolution time sample time successive approximation resolution sequence n cycles: 10 cycles qclk (2, 4, 8, 16) qadc byp conversion tim 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-16 user? manual 8.11.4 comparator the comparator is used during the approximation process to sense whether the digi- tally selected arrangement of the dac array produces a voltage level higher or lower than the sampled input. the comparator output feeds into the sar which accumulates the a/d conversion result sequentially, starting with the msb. 8.11.5 successive approximation register the input of the successive approximation register (sar) is connected to the compar- ator output. the sar sequentially receives the conversion value one bit at a time, starting with the msb. after accumulating the ten bits of the conversion result, the sar data is transferred to the appropriate result location, where it may be read by user software. 8.12 digital control subsystem the digital control subsystem includes conversion sequencing logic, channel selection logic, the clock and periodic/interval timer, control and status registers, the conversion command word table ram, and the result word table ram. the central element for control of the qadc conversions is the 40-entry conversion command word (ccw) table. each ccw specifies the conversion of one input chan- nel. depending on the application, one or two queues can be established in the ccw table. a queue is a scan sequence of one or more input channels. by using a pause mechanism, subqueues can be created in the two queues. each queue can be oper- ated using several different scan modes. the scan modes for queue 1 and queue 2 are programmed in qacr1 and qacr2. once a queue has been started by a trigger event (any of the ways to cause the qadc to begin executing the ccws in a queue or subqueue), the qadc performs a sequence of conversions and places the results in the result word table. 8.12.1 queue priority queue 1 has execution priority over queue 2 execution. table 8-3 shows the condi- tions under which queue 1 asserts its priority: 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-17 figure 8-7 shows the ccw format and an example of using pause to create sub- queues. queue 1 is shown with four ccws in each subqueue and queue 2 has two ccws in each subqueue. table 8-3 queue 1 priority assertion queue state result inactive a trigger event for queue 1 or queue 2 causes the corresponding queue execution to begin. queue 1 active/trigger event occurs for queue 2 queue 2 cannot begin execution until queue 1 reaches completion or the paused state. the status register records the trigger event by reporting the queue 2 status as trigger pending. additional trigger events for queue 2, which occur before exe- cution can begin, are recorded as trigger overruns. queue 2 active/trigger event occurs for queue 1 the current queue 2 conversion is aborted. the status register reports the queue 2 status as suspended. any trigger events occurring for queue 2 while queue 2 is suspended are recorded as trigger overruns. once queue 1 reaches the comple- tion or the paused state, queue 2 begins executing again. the programming of the resume bit in qacr2 determines which ccw is executed in queue 2. simultaneous trigger events occur for queue 1 and queue 2 queue 1 begins execution and the queue 2 status is changed to trigger pending. subqueues paused the pause feature can be used to divide queue 1 and/or queue 2 into multiple sub- queues. a subqueue is defined by setting the pause bit in the last ccw of the sub- queue. 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-18 user? manual figure 8-7 qadc queue operation with pause the queue operating mode selected for queue 1 determines what type of trigger event causes the execution of each of the subqueues within queue 1. similarly, the queue operating mode for queue 2 determines the type of trigger event required to execute each of the subqueues within queue 2. the choice of single-scan or continuous-scan applies to the full queue, and is not ap- plied to each subqueue. once a subqueue is initiated, each ccw is executed sequen- tially until the last ccw in the subqueue is executed and the pause state is entered. execution can only continue with the next ccw, which is the beginning of the next subqueue. a subqueue cannot be executed a second time before the overall queue execution has been completed. trigger events which occur during the execution of a subqueue are ignored, except that the trigger overrun flag is set. when continuous-scan mode is selected, a trigger event occurring after the completion of the last subqueue (after the queue completion flag is set), causes execution to continue with the first subqueue, starting with the first ccw in the queue. qadc cqp 00 begin queue 1 bq2 27 end of queue 1 begin queue 2 end of queue 2 00 39 channel select, sample, hold, and a/d conversion conversion command word (ccw) table result word table 0 p 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 p 1 p 0 pause pause pause pause pause pause 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-19 when the qadc encounters a ccw with the pause bit set, the queue enters the paused state after completing the conversion specified in the ccw with the pause bit. the pause flag is set and a pause software interrupt may optionally be issued. the sta- tus of the queue is shown to be paused, indicating completion of a subqueue. the qadc then waits for another trigger event to again begin execution of the next sub- queue. 8.12.2 queue boundary conditions a queue boundary condition occurs when one or more of the queue operating parameters is configured in a way that will inhibit queue execution. one such boundary condition is when the first ccw in a queue specified channel 63, the end-of-queue (eoq) code. in this case, the queue becomes active and the first ccw is read. the eoq code is recognized, the completion flag is set, and the queue becomes idle. a conversion is not performed. a similar situation occurs when bq2 (beginning of queue 2 pointer) is set beyond the end of the ccw table (between $28 and $3f) and a trigger event occurs for queue 2. the eoq condition is recognized immediately, the completion flag is set, and the queue becomes idle. a conversion is not performed. the qadc behaves the same way when bq2 is set to ccw0 and a trigger event occurs for queue 1. after reading ccw0, the eoq condition is recognized, the com- pletion flag is set, and the queue becomes idle. a conversion is not performed. multiple eoq conditions may be recognized simultaneously, but the qadc will not be- have differently. one example is when bq2 is set to ccw0, ccw0 contains the eoq code, and a trigger event occurs for queue 1. the qadc will read ccw0 and recog- nize the queue 1 trigger event, detecting both as eoq conditions. the completion flag will be set and queue 1 will become idle. boundary conditions also exist for combinations of pause and end-of-queue. one case is when a pause bit is in one ccw and an end-of-queue condition is in the next ccw. the conversion specified by the ccw with the pause bit set completes normally. the pause flag is set. however, since the end-of-queue condition is recognized, the com- pletion flag is also set and the queue status becomes idle, not paused. examples of this situation include: ?the pause bit is set in ccw5 and the channel 63 (eoq) code is in ccw6. ?the pause bit is set in ccw27. ?during queue 1 operation, the pause bit is set in ccw14 and bq2 points to ccw15. another pause and end-of-queue boundary condition occurs when the pause and an end-of-queue condition occur in the same ccw. both the pause and end-of-queue conditions are recognized simultaneously. the end-of-queue condition has prece- dence so a conversion is not performed for the ccw and the pause flag is not set. the qadc sets the completion flag and the queue status becomes idle. examples of this situation are: 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-20 user? manual ?the pause bit is set in ccw0a and eoq is programmed into ccw0a. ?during queue 1 operation, the pause bit is set in ccw20, which is also bq2. 8.12.3 scan modes the qadc queuing mechanism provides several methods for automatically scanning input channels. in single-scan mode, a single pass through a sequence of conversions defined by a queue is performed. in continuous-scan mode, multiple passes through a sequence of conversions defined by a queue are executed. the following para- graphs describe the disabled/reserved, single-scan, and continuous-scan operations. 8.12.3.1 disabled mode and reserved mode when the disabled mode or a reserved mode is selected, the queue is not active. note do not use a reserved mode. unspecified operations may result. trigger events cannot initiate queue execution. when both queue 1 and queue 2 are disabled, no wait states will be inserted by the qadc for accesses to the ccw and result word tables. when both queues are disabled, it is safe to change the qadc clock prescaler values. 8.12.3.2 single-scan modes when application software requires execution of a single pass through a sequence of conversions defined by a queue, a single-scan queue operating mode is selected. in all single-scan queue operating modes, software must enable a queue for execution by writing the single-scan enable bit to one in the queue? control register. the single- scan enable bits, sse1 and sse2, are provided for queue 1 and queue 2, respective- ly. until the single-scan enable bit is set, any trigger events for that queue are ignored. the single-scan enable bit may be set to one during the write cycle that selects the single-scan queue operating mode. the single-scan enable bit can be written as a one or a zero but is always read as a zero. after the single-scan enable bit is set, a trigger event causes the qadc to begin exe- cution with the first ccw in the queue. the single-scan enable bit remains set until the queue scan is complete; the qadc then clears the single-scan enable bit to zero. if the single-scan enable bit is written to one or zero before the queue scan is complete, the queue is not affected. however, if software changes the queue operating mode, the new queue operating mode and the value of the single-scan enable bit are recog- nized immediately. the current conversion is aborted and the new queue operating mode takes effect. by properly programming the mq1 field in qacr1 or the mq2 field in qacr2, the fol- lowing modes can be selected for queue 1 and/or 2: 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-21 ?software initiated single-scan mode ?software can initiate the execution of a scan sequence for queue 1 or 2 by selecting this mode, and setting the single-scan enable bit in qacr1 or qacr2. a trigger event is generated internally and the qadc immediately begins execution of the first ccw in the queue. if a pause is encountered, queue execution ceases momentarily while another trigger event is generated internally, and then execution continues. while the time to internally generate and act on a trigger event is very short, software can momentarily read the sta- tus conditions, indicating that the queue is paused. ?the qadc automatically performs the conversions in the queue until an end- of-queue condition is encountered. the queue remains idle until software again sets the single-scan enable bit. the trigger overrun flag is never set while in this mode. ?external trigger rising or falling edge single-scan mode ?this mode is a variation of the external trigger continuous-scan mode. it is available for both queue 1 and queue 2. software programs the external trigger to be either a rising or a falling edge. software must also set the single- scan enable bit for the queue in order for the scan to take place. the first ex- ternal trigger edge causes the queue to be executed one time. each ccw is read and the indicated conversions are performed until an end-of-queue con- dition is encountered. after the queue scan is complete, the qadc clears the single-scan enable bit. software may set the single-scan enable bit again to allow another scan of the queue to be initiated by the next external trigger edge. ?interval timer single-scan mode ?in addition to the above modes, queue 2 can also be programmed for the in- terval timer single-scan mode. the queue operating mode for queue 2 is se- lected by the mq2 field in qacr2. ?when this mode is selected and software sets the single-scan enable bit in qacr2, the periodic/interval timer begins counting. the timer interval can range from 2 7 to 2 17 qclk cycles in binary multiples. when the time interval expires, a trigger event is generated internally to start the queue. the timer is reloaded and begins counting again. meanwhile, the qadc begins execution with the first ccw in queue 2. ?the qadc automatically performs the conversions in the queue until a pause or an end-of-queue condition is encountered. when a pause is encountered, queue execution stops until the timer interval expires again; queue execution then continues. when an end of queue condition is encountered, the timer is held in reset and the single-scan enable bit is cleared. ?software may set the single-scan enable bit again, allowing another scan of the queue to be initiated by the interval timer. the interval timer generates a trigger event whenever the time interval elapses. the trigger event may cause queue execution to continue following a pause, or may be considered a trigger overrun if the queue is currently executing. 336376umbook page 21 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-22 user? manual 8.12.3.3 continuous-scan modes when application software requires execution of multiple passes through a sequence of conversions defined by a queue, a continuous-scan queue operating mode is selected. when a queue is programmed for a continuous-scan mode, the single-scan enable bit in the queue control register does not have any meaning or effect. as soon as the queue operating mode is programmed, the selected trigger event can initiate queue execution. in the case of the software initiated continuous-scan mode, the trigger event is gener- ated internally and queue execution begins immediately. in the other continuous-scan queue operating modes, the selected trigger event must occur before the queue can start. a trigger overrun is recorded if a trigger event occurs during queue execution in the external trigger continuous-scan mode and the periodic timer continuous-scan mode. when a pause is encountered during a scan, another trigger event is required for queue execution to continue. software involvement is not required for queue execution to continue from the paused state. after queue execution is complete, the queue status is shown as idle. since the con- tinuous-scan queue operating modes allow an entire queue to be scanned multiple times, software involvement is not required for queue execution to continue from the idle state. the next trigger event causes queue execution to begin again, starting with the first ccw in the queue. note it may not be possible to guarantee coherent samples when using the continuous-scan queue operating modes since the relationship between any two conversions may be variable due to programmable trigger events and queue priorities. by programming the mq1 field in qacr1 or the mq2 field in qacr2, the following modes can be selected for queue 1 and/or 2: ?software initiated continuous-scan mode ?when this mode is programmed, the trigger event is generated automatically by the qadc, and queue execution begins immediately. if a pause is encoun- tered, queue execution ceases for two qclks, while another trigger event is generated internally; execution then continues. when the end-of-queue is reached, another internal trigger event is generated, and queue execution be- gins again from the beginning of the queue. ?while the time to internally generate and act on a trigger event is very short, software can momentarily read the status conditions, indicating that the queue is paused or idle. the trigger overrun flag is never set while in the software ini- tiated continuous-scan mode. 336376umbook page 22 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-23 ?this mode keeps the result registers updated more frequently than any of the other queue operating modes. software can always read the result table to get the latest converted value for each channel. the channels scanned are kept up to date by the qadc without software involvement. ?this mode may be chosen for either queue, but is normally used only with queue 2. when the software initiated continuous-scan mode is chosen for queue 1, that queue operates continuously and queue 2, being lower in prior- ity, never gets executed. the short interval of time between a queue 1 pause and the internally generated trigger event, or between a queue 1 completion and the subsequent trigger event is not sufficient to allow queue 2 execution to begin. ?external trigger rising or falling edge continuous-scan mode ?the qadc provides external trigger pins for both queues. when this mode is selected, a transition on the associated external trigger pin initiates queue ex- ecution. the external trigger is programmable, so that queue execution can begin on either a rising or a falling edge. each ccw is read and the indicated conversions are performed until an end-of-queue condition is encountered. when the next external trigger edge is detected, queue execution begins again automatically. software initialization is not needed between trigger events. ?periodic timer continuous-scan mode ?in addition to the previous modes, queue 2 can also be programmed for the periodic timer continuous-scan mode, where a scan is initiated at a selectable time interval using the on-chip periodic/interval timer. the queue operating mode for queue 2 is selected by the mq2 field in qacr2. ?the qadc includes a dedicated periodic/interval timer for initiating a scan sequence for queue 2 only. a programmable timer interval can be selected ranging from 2 7 to 2 17 times the qclk period in binary multiples. ?when this mode is selected, the timer begins counting. after the programmed interval elapses, the timer generated trigger event starts the queue. the timer is then reloaded and begins counting again. meanwhile, the qadc automati- cally performs the conversions in the queue until an end-of-queue condition or a pause is encountered. when a pause is encountered, the qadc waits for the periodic interval to expire again, then continues with the queue. when an end-of-queue is encountered, the next trigger event causes queue execution to begin again with the first ccw in queue 2. ?the periodic timer generates a trigger event whenever the time interval elapses. the trigger event may cause queue execution to continue following a pause or queue completion, or may be considered a trigger overrun. as with all continuous-scan queue operating modes, software action is not needed be- tween trigger events. ?if the queue completion interrupt is enabled when using this mode, software can read the analog results that have just been collected. software can use this interrupt to obtain non-analog inputs as well, as part of a periodic look at all inputs. 336376umbook page 23 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-24 user? manual 8.12.4 qadc clock (qclk) generation figure 8-8 is a block diagram of the clock subsystem. qclk provides the timing for the a/d converter state machine which controls the timing of conversions. qclk is also the input to a 17-stage binary divider which implements the periodic/interval timer. to obtain the specified analog conversion accuracy, the qclk frequency (f qclk ) must be within the tolerance specified in table a-13 . before using the qadc, software must initialize the prescaler with values that put qclk within a specified range. though most applications initialize the prescaler once and do not change it, write operations to the prescaler fields are permitted. caution a change in the prescaler value while a conversion is in progress is likely to corrupt the conversion result. therefore, any prescaler write operation should be done only when both queues are disabled. figure 8-8 qadc clock subsystem functions qadc clock block prescaler rate selection (from qacr0): binary counter periodic/interval timer select 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 16 2 17 one's complement compare clock generate 5-bit down counter zero detect reset qclk load psh set qclk qclk qadc clock ( 2 to 40 ) low time cycles (psl) add half cycle to high (psa) high time cycles (psh) input sample time (from ccw) queue 2 mode rate selection (from qacr2): sar control sar[9:0] periodic/interval trigger event 53 3 3 5 4 system clock (f sys ) a/d converter state machine 336376umbook page 24 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-25 to accommodate wide variations of the main mcu clock frequency f sys , qclk is generated by a programmable prescaler which divides the mcu system clock to a frequency within the specified qclk tolerance range. the prescaler also allows the duty cycle of the qclk waveform to be programmable. the basic high phase of the qclk waveform is selected with the psh (prescaler clock high time) field in qacr0, and the basic low phase of qclk with the psl (prescaler clock low time) field. the duty cycle of qclk can be further modified with the psa (prescaler add a clock tick) bit in qacr0. the combination of the psh and psl pa- rameters establishes the frequency of qclk. figure 8-8 shows that the prescaler is essentially a variable pulse width signal gener- ator. a 5-bit down counter, clocked at the system clock rate, is used to create both the high phase and the low phase of the qclk signal. at the beginning of the high phase, the 5-bit counter is loaded with the 5-bit psh value. when the zero detector finds that the high phase is finished, qclk is reset. a 3-bit comparator looks for a one? com- plement match with the 3-bit psl value, which is the end of the low phase of qclk. the psa bit allows the qclk high-to-low transition to be delayed by a half cycle of the input clock. the following sequence summarizes the process of determining what values are to be put into the prescaler fields in qacr0: 1. choose the system clock frequency f sys . 2. choose first-try values for psh, psl, and psa, then skip to step 4. 3. choose different values for psh, psl, and psa. 4. if the qclk high time is less than t psh (qadc clock duty cycle ?minimum high phase time), return to step 3. refer to table a-13 for more information on t psh . qclk high time is determined by the following equation: where psh = 0 to 31 and psa = 0 or 1. 5. if qclk low time is less than t psl (qadc clock duty cycle ?minimum low phase time), return to step 3. refer to table a-13 for more information on t psl . qclk low time is determined by the following equation: where psl = 0 to 7 and psa = 0 or 1. qclk high time (in ns) 1000 1 psh 0.5 psa ++ () f sys (in mhz) ---------------------------------------------------------------------- = qclk low time (in ns) 1000 1 psl 0.5 psa + () f sys (in mhz) -------------------------------------------------------------------- - = 336376umbook page 25 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-26 user? manual 6. calculate the qclk frequency (f qclk ). 7. choose the number of input sample cycles (2, 4, 8, or 16) for a typical input channel. 8. if the calculated conversion times are not sufficient, return to step 3. conversion time is determined by the following equation: 9. code the selected psh, psl, and psa values into the prescaler fields of qacr0. figure 8-9 and table 8-4 show examples of qclk programmability. the examples include conversion times based on the following assumptions: ?f sys = 20.97 mhz. ?input sample time is as fast as possible (ist[1:0] = %00, 2 qclk cycles). figure 8-9 and table 8-4 also show the conversion time calculated for a single con- version in a queue. for other mcu system clock frequencies and other input sample times, the same calculations can be made. figure 8-9 qadc clock programmability examples f qclk (in mhz) 1000 = () qclk high time (in ns) qclk low time (in ns) + ----------------------------------------------------------------------------------------------------------------------------- conversion time (in m s ) 16 number of input sample cycles + f qclk (in mhz) ---------------------------------------------------------------------------------------------- - = qclk examples f sys ex1 ex2 system clock qadc qclk ex 16 cycles 336376umbook page 26 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-27 the mcu system clock frequency is the basis of qadc timing. the qadc requires that the system clock frequency be at least twice the qclk frequency. refer to table a-13 for information on the minimum and maximum allowable qclk frequencies. example 1 in figure 8-9 shows that when psh = 3, the qclk remains high for four system clock cycles. it also shows that when psl = 3, the qclk remains low for four system clock cycles. in order to tune qclk for the fastest possible conversion time for any given system clock frequency, the qadc permits one more programmable control of the qclk high and low time. the psa bit in qacr0 allows the qclk high phase to be stretched for a half cycle of the system clock, and correspondingly, the qclk low phase is short- ened by a half cycle of the system clock. example 2 in figure 8-9 is the same as example 1, except that the psa bit is set. the qclk high phase has 4.5 system clock cycles; the qclk low phase has 3.5 system clock cycles. 8.12.5 periodic/interval timer the qadc periodic/interval timer can be used to generate trigger events at program- mable intervals to initiate scans of queue 2. the periodic/interval timer is held in reset under the following conditions: ?queue 2 is programmed to any queue operating mode which does not use the periodic/interval timer ?interval timer single-scan mode is selected, but the single-scan enable bit is cleared to zero ?imb system reset or the master reset is asserted ?the qadc is placed in low-power stop mode with the stop bit ?the imb freeze line is asserted and the qadc frz bit is set to one two other conditions which cause a pulsed reset of the timer are: ?rollover of the timer counter ?a queue operating mode change from one periodic/interval timer mode to another periodic/interval timer mode during the low-power stop mode, the periodic/interval timer is held in reset. since low- power stop mode initializes qacr2 to zero, a valid periodic or interval timer mode must be written to qacr2 when exiting low-power stop mode to release the timer from reset. table 8-4 qadc clock programmability control register 0 information f sys = 20.97 input sample time (ist) = %00 example number psh[4:0] psa psl[2:0] qclk (mhz) conversion time ( m s) 17071.0 18.0 27171.0 18.0 336376umbook page 27 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-28 user? manual if the qadc frz bit is set to one and the imb freeze line is asserted while a periodic or interval timer mode is selected, the timer is reset after the current conversion completes. when a periodic or interval timer mode has been enabled (the timer is counting), but a trigger event has not been issued, freeze mode takes effect immedi- ately, and the timer is held in reset. when the imb freeze line is negated, the timer starts counting from zero. 8.12.6 control and status registers the following paragraphs describe the control and status registers. the qadc has three control registers and one status register. all of the implemented control register fields can be read or written. reserved locations read zero and writes have no effect. the control registers are typically written once when software initializes the qadc and are not changed afterwards. refer to d.5.6 qadc control registers for register and bit descriptions. 8.12.6.1 control register 0 (qacr0) control register qacr0 establishes the qclk with prescaler parameter fields and de- fines whether external multiplexing is enabled. 8.12.6.2 control register 1 (qacr1) control register qacr1 is the mode control register for queue 1. applications software defines the operating mode for the queue, and may enable a completion and/or pause interrupt. the sse1 bit may be written to one or zero but always reads zero. 8.12.6.3 control register 2 (qacr2) control register qacr2 is the mode control register for queue 2. applications software defines the operating mode for the queue, and may enable a completion and/or pause interrupt. the sse2 bit may be written to one or zero but always reads zero. 8.12.6.4 status register (qasr) the status register qasr contains information about the state of each queue and the current a/d conversion. except for the four flag bits (cf1, pf1, cf2, and pf2) and the two trigger overrun bits (tor1 and tor2), all of the status register fields contain read- only data. the four flag bits and the two trigger overrun bits are cleared by writing a zero to the bit after the bit was previously read as a one. 8.12.7 conversion command word table the ccw table is a 40-word long, 10-bit wide ram, which can be programmed to request conversions of one or more analog input channels. the entries in the ccw table are 10-bit conversion command words. the ccw table is written by software and is not modified by the qadc. each ccw requests the conversion of an analog chan- nel to a digital result. the ccw specifies the analog channel number, the input sample time, and whether the queue is to pause after the current ccw. refer to d.5.8 con- version command word table for register and bit descriptions. 336376umbook page 28 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-29 the ten implemented bits of the ccw word can be read and written. unimplemented bits are read as zeros, and write operations have no effect. each location in the ccw table corresponds to a location in the result word table. when a conversion is complet- ed for a ccw entry, the 10-bit result is written in the corresponding result word entry. the beginning of queue 1 is the first location in the ccw table. the first location of queue 2 is specified by the beginning of queue 2 pointer bq2 in qacr2. to dedicate the entire ccw table to queue 1, queue 2 is disabled, and bq2 is programmed to any value greater than 39. to dedicate the entire ccw table to queue 2, queue 1 is disabled, and bq2 is specified as the first location in the ccw table. figure 8-10 illustrates the operation of the queue structure. figure 8-10 qadc conversion queue operation qadc cq 00 begin queue 1 bq2 39 end of queue 1 begin queue 2 end of queue 2 p ist[1:0] chan[5:0] 97 8 6 4321 50 chan[5:0] = channel number and end-of-queue code 10-bit conversion command word format 00 39 result 7 864321 5 90 8 10 11 12 13 14 15 result 97 8 4321 50 8 10 11 12 13 14 6 15 s result 97 8 4321 50 8 10 11 12 13 14 6 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 right justified, unsigned result left justified, unsigned result left justified, signed result 10-bit result, readable in three 16-bit formats s = sign bit channel select, sample, hold, and a/d conversion conversion command word (ccw) table result word table byp byp = bypass p = pause until next trigger ist[1:0] = input sample time 336376umbook page 29 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-30 user? manual to prepare the qadc for a scan sequence, the desired channel conversions are writ- ten to the ccw table. software establishes the criteria for initiating the queue execu- tion by programming queue operating mode. the queue operating mode determines what type of trigger event initiates queue execution. a scan sequence may be initiated by the following trigger events: ?a software command ?expiration of the periodic/interval timer ?an external trigger signal software also specifies whether the qadc is to perform a single pass through the queue or is to scan continuously. when a single-scan mode is selected, queue execu- tion begins when software sets the single-scan enable bit. when a continuous-scan mode is selected, the queue remains active in the selected queue operating mode af- ter the qadc completes each queue scan sequence. during queue execution, the qadc reads each ccw from the active queue and exe- cutes conversions in four stages: 1. initial sample 2. transfer 3. final sample 4. resolution during initial sample, the selected input channel is connected to the sample capacitor at the input of the sample buffer amplifier. during the transfer period, the sample capacitor is disconnected from the multiplexer, and the stored voltage is buffered and transferred to the rc dac array. during the final sample period, the sample capacitor and amplifier are bypassed, and the multiplexer input charges the rc dac array directly. each ccw specifies a final input sample time of 2, 4, 8, or 16 qclk cycles. when an analog-to-digital conversion is complete, the result is written to the corresponding location in the result word table. the qadc continues to sequentially execute each ccw in the queue until the end of the queue is detected or a pause bit is found in a ccw. when the pause bit is set in the current ccw, the qadc stops execution of the queue until a new trigger event occurs. the pause status flag bit is set, which may generate an interrupt request to notify software that the queue has reached the pause state. when the next trigger event occurs, the paused state ends, and the qadc continues to execute each ccw in the queue until another pause is encountered or the end of the queue is detected. an end-of-queue condition is indicated as follows: ?the ccw channel field is programmed with 63 ($3f) to specify the end of the queue. ?the end of queue 1 is implied by the beginning of queue 2, which is specified in the bq2 field in qacr2. ?the physical end of the queue ram space defines the end of either queue. 336376umbook page 30 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-31 when any of the end-of-queue conditions is recognized, a queue completion flag is set, and if enabled, an interrupt request is generated. the following situations prema- turely terminate queue execution: ?since queue 1 is higher in priority than queue 2, when a trigger event occurs on queue 1 during queue 2 execution, the execution of queue 2 is suspended by aborting execution of the ccw in progress, and queue 1 execution begins. when queue 1 execution is complete, queue 2 conversions restart with the first ccw entry in queue 2 or the first ccw of the queue 2 subqueue being executed when queue 2 was suspended. alternately, conversions can restart with the aborted queue 2 ccw entry. the resume res bit in qacr2 allows software to select where queue 2 begins after suspension. by choosing to re-execute all of the sus- pended queue 2 and subqueue ccws, all of the samples are guaranteed to have been taken during the same scan pass. however, a high trigger event rate for queue 1 can prohibit the completion of queue 2. if this occurs, execution of queue 2 may begin with the aborted ccw entry. ?when a queue is disabled, any conversion taking place for that queue is aborted. putting a queue into disabled mode does not power down the converter. ?when the operating mode of a queue is changed to another valid mode, any conversion taking place for that queue is aborted. the queue operating restarts at the beginning of the queue, once an appropriate trigger event occurs. ?when placed in low-power stop mode, the qadc aborts any conversion in progress. ?when the frz bit in the qadcmcr is set and the imb freeze line is asserted, the qadc freezes at the end of the current conversion. when freeze is negat- ed, the qadc resumes queue execution beginning with the next ccw entry. 8.12.8 result word table the result word table is a 40-word long, 10-bit wide ram. the qadc writes a result word after completing an analog conversion specified by the corresponding ccw. the result word table can be read or written, but in normal operation, software reads the result word table to obtain analog conversions from the qadc. unimplemented bits are read as zeros, and write operations have no effect. refer to d.5.9 result word table for register descriptions. while there is only one result word table, the data can be accessed in three different alignment formats: 1. right justified, with zeros in the higher order unused bits. 2. left justified, with the most significant bit inverted to form a sign bit, and zeros in the unused lower order bits. 3. left justified, with zeros in the unused lower order bits. the left justified, signed format corresponds to a half-scale, offset binary, two? com- plement data format. the data is routed onto the imb according to the selected format. the address used to access the table determines the data alignment format. all write operations to the result word table are right justified. 336376umbook page 31 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-32 user? manual 8.13 interrupts the qadc supports both polled and interrupt driven operation. status bits in qasr reflect the operating condition of each queue and can optionally generate interrupts when enabled by the appropriate bits in qacr1 and/or qacr2. 8.13.1 interrupt sources the qadc has four interrupt service sources, each of which is separately enabled. each time the result is written for the last ccw in a queue, the completion flag for the corresponding queue is set, and when enabled, an interrupt request is generated. in the same way, each time the result is written for a ccw with the pause bit set, the queue pause flag is set, and when enabled, an interrupt request is generated. table 8-5 displays the status flag and interrupt enable bits which correspond to queue 1 and queue 2 activity. both polled and interrupt-driven qadc operations require that status flags must be cleared after an event occurs. flags are cleared by first reading qasr with the appro- priate flag bits set to one, then writing zeros to the flags that are to be cleared. a flag can be cleared only if the flag was a logic one at the time the register was read by the cpu. if a new event occurs between the time that the register is read and the time that it is written, the associated flag is not cleared. 8.13.2 interrupt register the qadc interrupt register qadcint specifies the priority level of qadc interrupt requests and the upper six bits of the vector number provided during an interrupt ac- knowledge cycle. the values contained in the irlq1 and irlq2 fields in qadcint determine the pri- ority of qadc interrupt service requests. a value of %000 in either field disables the interrupts associated with that field. the interrupt levels for queue 1 and queue 2 may be different. the ivb[7:2] bits specify the upper six bits of each qadc interrupt vector number. ivb[1:0] have fixed assignments for each of the four qadc interrupt sources. refer to 8.13.3 interrupt vectors for more information. table 8-5 qadc status flags and interrupt sources queue queue activity status flag interrupt enable bit queue 1 result written for the last ccw in queue 1 cf1 cie1 result written for a ccw with pause bit set in queue 1 pf1 pie1 queue 2 result written for the last ccw in queue 2 cf2 cie2 result written for a ccw with pause bit set in queue 2 pf2 pie2 336376umbook page 32 friday, november 15, 1996 2:09 pm
MC68336/376 queued analog-to-digital converter module motorola user? manual 8-33 8.13.3 interrupt vectors when the qadc is the only module with an interrupt request pending at the level being acknowledged, or when the qadc iarb value is higher than that of other modules with requests pending at the acknowledged irq level, the qadc responds to the in- terrupt acknowledge cycle with an 8-bit interrupt vector number. the cpu32 uses the vector number to calculate a displacement into the exception vector table, then uses the vector at that location to jump to an interrupt service routine. the interrupt vector base field ivb[7:2] specifies the six high-order bits of the 8-bit in- terrupt vector number, and the qadc provides two low-order bits which correspond to one of the four qadc interrupt sources. figure 8-11 shows the format of the interrupt vector, and lists the binary coding of the two low-order bits for the four qadc interrupt sources. figure 8-11 qadc interrupt vector format the ivb field has a reset value of $0f, which corresponds to the uninitialized interrupt exception vector. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 ivb0 ivb1 ivb3 ivb4 ivb5 ivb6 ivb2 ivb7 1 1 0 1 1 0 0 0 ?queue 1 completion software interrupt ?queue 1 pause software interrupt ?queue 2 completion software interrupt ?queue 2 pause software interrupt vector bits provided by qadc interrupt register provided by software during interrupt arbitration qadc swi vect ivb0 ivb1 ivb3 ivb4 ivb5 ivb6 ivb2 ivb7 qadc interrupt vector number provided 336376umbook page 33 friday, november 15, 1996 2:09 pm
motorola queued analog-to-digital converter module MC68336/376 8-34 user? manual 8.13.4 initializing the qadc for interrupt driven operation the following steps are required to ensure proper operation of qadc interrupts: 1. assign the qadc a unique non-zero iarb value. the iarb field is located in qadcmcr. the lowest priority iarb value is %0001, and the highest priority iarb value is %1111. 2. set the interrupt request levels for queue 1 and queue 2 in the irlq1 and irlq2 fields in qadcint. level %001 is the lowest priority interrupt request, and level %111 is the highest priority request. 3. set the six high-order bits of the eight-bit ivb field in qadcint. the qadc pro- vides the two low-order vector bits to identify one of four qadc interrupt re- quests. the vector number for each qadc interrupt source corresponds to a specific vector in the exception vector table. each vector in the exception vector table points to the beginning address of an exception handler routine. 336376umbook page 34 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-1 section 10 configurable timer module 4 this section is an overview of ctm4 function. refer to the ctm reference manual (ctmrm/ad) for a comprehensive discussion of ctm capabilities. 10.1 general the configurable timer module 4 (ctm4) consists of several submodules which are lo- cated on either side of the ctm4 internal submodule bus (smb). all data and control signals within the ctm4 are passed over this bus. the smb is connected to the out- side world via the bus interface unit submodule (biusm), which is connected to the intermodule bus (imb), and subsequently the cpu32. this configuration allows the cpu32 to access the data and control registers in each ctm4 submodule on the smb. three time base buses (tbb1, tbb2 and tbb4), each 16-bits wide, are used to trans- fer timing information from counters to action submodules. figure 10-1 shows a block diagram of the ctm4. figure 10-1 ctm4 block diagram free-running submodule (fcsm12) counter modulus counter submodule (mcsm11) cpwm8 double action submodule (dasm10) ctd10 pulse width modulation submodule (pwmsm7) cpwm7 pulse width modulation submodule (pwmsm6) cpwm6 pulse width modulation submodule (pwmsm5) cpwm5 double action submodule (dasm9) ctd9 double action submodule (dasm4) ctd4 double action submodule (dasm3) ctd3 load pclk1 (f sys ? 2 or f sys ? 3) modulus counter submodule (mcsm2) ctm2c external clock time base bus 2 (tbb2) time base bus 1 (tbb1) time base bus 4 (tbb4) global time base bus a global time base bus b bus interface unit submodule (biusm) clock prescaler submodule (cpsm) pulse width modulation submodule (pwmsm8) ctm4 block 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-2 user? manual the time base buses originate in a counter submodule and are used by the action sub- modules. two time base buses are accessible to each submodule. the bus interface unit submodule (biusm) allows all the ctm4 submodules to pass data to and from the imb via the submodule bus (smb). the counter prescaler submodule (cpsm) generates six different clock frequencies which can be used by any counter submodule. this submodule is contained within the biusm. the free-running counter submodule (fcsm) has a 16-bit up counter with an associ- ated clock source selector, selectable time-base bus drivers, writable control registers, readable status bits, and interrupt logic.the ctm4 has one fcsm. the modulus counter submodule (mcsm) is an enhanced fcsm. a modulus register gives the additional flexibility of recycling the counter at a count other than 64k clock cycles. the ctm4 has two mcsms. the double-action submodule (dasm) provides two 16-bit input capture or two 16-bit output compare functions that can occur automatically without software intervention. the ctm4 has four dasms. the pulse width modulation submodule (pwmsm) can generate pulse width modulated signals over a wide range of frequencies, independently of other ctm out- put signals. pwmsms are not affected by time base bus activity. the ctm4 has four pwmsms. 10.2 address map the ctm4 address map occupies 256 bytes from address $yff400 to $yff4ff. all ctm4 registers are accessible only when the cpu32 is in supervisor mode. all re- served addresses return zero when read, and writes have no effect. refer to d.7 con- figurable timer module 4 for information concerning ctm4 address map and register bit/field descriptions. 10.3 time base bus system the ctm4 time base bus system is composed of three 16-bit buses: tbb1, tbb2, and tbb4. these buses are used to transfer timing information from the counter submod- ules to the action submodules. two time base buses are available to each submodule. a counter submodule can drive one of the two time base buses to which it is connect- ed. each action submodule can choose one of the two time base buses to which it is connected as its time base. control bits within each ctm4 submodule select connec- tion to the appropriate time base bus. the time base buses are precharge/discharge type buses with wired-or capability. therefore, no hardware damage occurs when more than one counter drives the same bus at the same time. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-3 in the ctm4, tbb2 is global and accessible to every submodule. tbb1 and tbb4 are split to form two local time base buses. table 10-1 shows which time base buses are available to each ctm4 submodule. each pwmsm has an independent 16-bit counter and 8-bit prescaler clocked by the pclk1 signal, which is generated by the cpsm. the pwmsms are not connected to any of the time base buses. refer to 10.9 pulse-width modulation submodule (pwmsm) for more information. 10.4 bus interface unit submodule (biusm) the biusm connects the smb to the imb and allows the ctm4 submodules to com- municate with the cpu32. the biusm also communicates ctm4 submodule interrupt requests to the imb, and transfers the interrupt level, arbitration number and vector number to the cpu32 during the interrupt acknowledge cycle. 10.4.1 stop effect on the biusm when the cpu32 stop instruction is executed, only the cpu32 is stopped; the ctm4 continues to operate as normal. 10.4.2 freeze effect on the biusm ctm4 response to assertion of the imb freeze signal is controlled by the frz bit in the biusm configuration register (biumcr). since the biusm propagates freeze to the ctm4 submodules via the smb, the setting of frz affects all ctm4 submod- ules. if the imb freeze signal is asserted and frz = 1, all ctm4 submodules freeze. the following conditions apply when the ctm4 is frozen: ?all submodule registers can still be accessed. ?the cpsm, fcsm, mcsm, and pwmsm counters stop counting. ?the in status bit still reflects the state of the fcsm external clock input pin. ?the in2 status bit still reflects the state of the mcsm external clock input pin, and the in1 status bit still reflects the state of the mcsm modulus load input pin. ?dasm capture and compare functions are disabled. ?the dasm in status bit still reflects the state of its associated pin in the dis, ipwm, ipm, and ic modes. in the ocb, ocab, and opwm modes, in reflects the state of the dasm output flip flop. ?when configured for ocb, ocab, or opwm modes, the state of the dasm table 10-1 ctm4 time base bus allocation global/local time base bus allocation global/local time base bus allocation submodule global bus a global bus b submodule global bus a global bus b dasm9 tbb1 tbb2 mcsm 2 tbb4 tbb2 dasm10 tbb1 tbb2 dasm 3 tbb4 tbb2 mcsm 11 tbb1 tbb2 dasm 4 tbb4 tbb2 fcsm 12 tbb1 tbb2 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-4 user? manual output flip-flop will remain unchanged. ?the state of the pwmsm output flip-flop will remain unchanged. if the imb freeze signal is asserted and frz = 0, the freeze condition is ignored, and all ctm4 submodules will continue to operate normally. 10.4.3 lpstop effect on the biusm when the cpu32 lpstop instruction is executed, the system clock is stopped. all de- pendent modules, including the ctm4, are shut down until low-power stop mode is exited. 10.4.4 biusm registers the biusm contains a module configuration register, a time base register, and a test register. the biusm register block occupies the first four register locations in the ctm4 register space. all unused bits and reserved address locations return zero when read. writes to unused bits and reserved address locations have no effect. refer to d.7.1 biu module configuration register , d.7.2 biusm test configuration reg- ister , and d.7.3 biusm time base register for information concerning biusm reg- ister and bit descriptions. 10.5 counter prescaler submodule (cpsm) the counter prescaler submodule (cpsm) is a programmable divider system that pro- vides the ctm4 counters with a choice of six clock signals (pclk[1:6]) derived from the main mcu system clock. five of these frequencies are derived from a fixed divider chain. the divide ratio of the last clock frequency is software selectable from a choice of four divide ratios. the cpsm is part of the biusm. figure 10-2 shows a block diagram of the cpsm. figure 10-2 cpsm block diagram ctm cpsm block f sys 8-bit pclk2 = pclk3 = pclk4 = pclk5 = pclk6 = first cpsm select pclk1 = ? 2 ? 4 ? 8 ? 16 ? 32 prescaler ? 64 ? 128 ? 256 prun div23 psel1 psel0 cpcr prescaler ? 2 or ? 3 f sys ? 2 f sys ? 4 f sys ? 8 f sys ? 16 f sys ? 32 f sys ? 64 f sys ? 128 f sys ? 256 f sys ? 512 f sys ? 3 f sys ? 6 f sys ? 12 f sys ? 24 f sys ? 48 f sys ? 96 f sys ? 192 f sys ? 384 f sys ? 768 div23 = ? 3 div23 = ? 2 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-5 10.5.1 cpsm registers the cpsm contains a control register (cpcr) and a test register (cptr). all unused bits and reserved address locations return zero when read. writes to unused bits and reserved address locations have no effect. refer to d.7.4 cpsm control register and d.7.5 cpsm test register for information concerning cpsm register and bit de- scriptions. 10.6 free-running counter submodule (fcsm) the free-running counter submodule (fcsm) has a 16-bit up counter with an associ- ated clock source selector, selectable time-base bus drivers, control registers, status bits, and interrupt logic. when the 16-bit up counter overflows from $ffff to $0000, an optional overflow interrupt request can be generated. the current state of the 16- bit counter is the primary output of the counter submodules. the user can select which, if any, time base bus is to be driven by the 16-bit counter. a software control register selects whether the clock input to the counter is one of the taps from the prescaler or an input pin. the polarity of the external input pin is also programmable. in order to count, the fcsm requires the cpsm clock signals to be present. after re- set, the fcsm does not count until the prescaler in the cpsm starts running (when the software sets the prun bit). this allows all counters in the ctm4 submodules to be synchronized. the ctm4 has one fcsm. figure 10-3 shows a block diagram of the fcsm. figure 10-3 fcsm block diagram ctm fcsm block 16-bit up counter il2 il1 il0 iarb3 cof edge time base buses il1 interrupt clock in clk1 clk0 clk2 overflow bus control register bits control register bits drva drvb control register bits 6 clocks (pclk[1:6]) from prescaler submodule bus control select select detect tbba tbbb input pin ctm2c 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-6 user? manual 10.6.1 fcsm counter the fcsm counter consists of a 16-bit register and a 16-bit up-counter. reading the register transfers the contents of the counter to the data bus, while a write to the register loads the counter with a new value. overflow of the counter is defined to be the transition from $ffff to $0000. an overflow condition sets the counter overflow flag (cof) in the fcsm status/interrupt/control register (fcsmsic). note reset presets the counter register to $0000. writing $0000 to the counter register while the counter? value is $ffff does not set the cof flag and does not generate an interrupt request. 10.6.2 fcsm clock sources the fcsm has eight software selectable counter clock sources, including: ?six cpsm prescaler outputs (pclk[1:6]) ?rising edge on ctm2c input ?falling edge on the ctm2c input the clock source is selected by the clk[2:0] bits in fcsmsic. when the clk[2:0] bits are being changed, internal circuitry guarantees that spurious edges occurring on the ctm2c pin do not affect the fcsm. the read-only in bit in fcsmsic reflects the state of ctm2c. this pin is schmitt-triggered and is synchronized with the system clock. the maximum allowable frequency for a clock input on ctm2c is f sys /4. 10.6.3 fcsm external event counting when an external clock source is selected, the fcsm can act as an event counter simply by counting the number of events occurring on the ctm2c input pin. alterna- tively, the fcsm can be programmed to generate an interrupt request when a pre- defined number of events have been counted. this is done by presetting the counter with the two? complement value of the desired number of events. 10.6.4 fcsm time base bus driver the drva and drvb bits in fcsmsic select the time base bus to be driven. which of the time base buses is driven depends on where the fcsm is physically placed in any particular ctm implementation. refer to figure 10-1 and table 10-1 for more information. warning two time base buses should not be driven at the same time. 10.6.5 fcsm interrupts the fcsm can optionally request an interrupt when its counter overflows and the cof bit in fcsmsic is set. to enable interrupts, set the il[2:0] field in the fcsmsic to a non-zero value. the ctm4 compares the cpu32 ip mask value to the priority of the requested interrupt designated by il[2:0] to determine whether it should contend for 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-7 arbitration priority. during arbitration, the biusm provides the arbitration value speci- fied by iarb[2:0] in biumcr and iarb3 in fcsmsic. if the ctm4 wins arbitration, it responds with a vector number generated by concatenating vect[7:6] in biumcr and the six low-order bits specified by the number of the submodule requesting ser- vice. thus, for fcsm12 in ctm4, six low-order bits would be 12 in decimal, or %001100 in binary. 10.6.6 fcsm registers the fcsm contains a status/interrupt/control register and a counter register. all un- used bits and reserved address locations return zero when read. writes to unused bits and reserved address locations have no effect. refer to d.7.6 fcsm status/inter- rupt/control register and d.7.7 fcsm counter register for information concerning fcsm register and bit descriptions. 10.7 modulus counter submodule (mcsm) the modulus counter submodule (mcsm) is an enhanced fcsm. the mcsm con- tains a 16-bit modulus latch, a 16-bit loadable up-counter, counter loading logic, a clock selector, selectable time base bus drivers, and an interrupt interface. a modulus register provides the added flexibility of recycling the counter at a count other than 64k clock cycles. the content of the modulus latch is transferred to the counter when an overflow occurs, or when a user-specified edge transition occurs on a designated modulus load input pin. in addition, a write to the modulus counter simultaneously loads both the counter and the modulus latch with the specified value. the counter then begins incrementing from this new value. in order to count, the mcsm requires the cpsm clock signals to be present. after re- set, the mcsm does not count until the prescaler in the cpsm starts running (when the software sets the prun bit). this allows all counters in the ctm4 submodules to be synchronized. the ctm4 contains two mcsms. figure 10-4 shows a block diagram of the mcsm. 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-8 user? manual figure 10-4 mcsm block diagram 10.7.1 mcsm modulus latch the 16-bit modulus latch is a read/write register that is used to reload the counter au- tomatically with a predetermined value. the contents of the modulus latch register can be read at any time. writing to the register loads the modulus latch with the new value. this value is then transferred to the counter register when the next load condition occurs. however, writing to the corresponding counter register loads the modulus latch and the counter register immediately with the new value. the modulus latch reg- ister is cleared to $0000 by reset. 10.7.2 mcsm counter the counter is composed of a 16-bit read/write register associated with a 16-bit incre- menter. reading the counter transfers the contents of the counter register to the data bus. writing to the counter loads the modulus latch and the counter register immedi- ately with the new value. 10.7.2.1 loading the mcsm counter register the mcsm counter is loaded either by writing to the counter register or by loading it from the modulus latch when a counter overflow occurs. counter overflow will set the cof bit in the mcsm status/interrupt/control register (mcsmsic). note when the modulus latch is loaded with $ffff, the overflow flag is set on every counter clock pulse. interrupt control clock input pin ctm2c ctm mcsm block 16-bit up counter il2 il1 il0 iarb3 cof edge time base buses il1 clock in2 clk1 clk0 clk2 overflow bus control register bit control register bits 6 clocks (pclk[1:6]) from prescaler submodule bus select select detect modulus control modulus register control register bits edgen edgep edge modulus load detect input pin ctml in1 control register bits write both drva drvb control register bits tbba tbbb modulus control register bit load input pin ctd9 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-9 10.7.2.2 using the mcsm as a free-running counter although the mcsm is a modulus counter, it can operate like a free-running counter by loading the modulus register with $0000. 10.7.3 mcsm clock sources the mcsm has eight software selectable counter clock sources, including: ?six cpsm prescaler outputs (pclk[1:6]) ?rising edge on the ctm2c input ?falling edge on the ctm2c input the clock source is selected by the clk[2:0] bits in mcsmsic. when the clk[2:0] bits are being changed, internal circuitry guarantees that spurious edges occurring on the ctm2c pin do not affect the mcsm. the read only in2 bit in mcsmsic reflects the state of ctm2c. this pin is schmitt-triggered, and is synchronized with the system clock. the maximum allowable frequency for a clock signal input on ctm2c is f sys /4. 10.7.4 mcsm external event counting when an external clock source is selected, the mcsm can act as an event counter simply by counting the number of events occurring on the ctm2c input pin. alterna- tively, the mcsm can be programmed to generate an interrupt when a predefined number of events have been counted. this is done by presetting the counter with the two? complement value of the desired number of events. 10.7.5 mcsm time base bus driver the drva and drvb bits in mcsmsic select the time base bus to be driven. which of the time base buses is driven depends on where the mcsm is physically placed in any particular ctm implementation. refer to figure 10-1 and table 10-1 for more information. warning two time base buses should not be driven at the same time. 10.7.6 mcsm interrupts the mcsm can optionally request an interrupt when its counter overflows and the cof bit in mcsmsic is set. to enable interrupts, set the il[2:0] field in the mcsmsic to a non-zero value. the ctm4 compares the cpu32 ip mask value to the priority of the requested interrupt designated by il[2:0] to determine whether it should contend for arbitration priority. during arbitration, the biusm provides the arbitration value specified by iarb[2:0] in biumcr and iarb3 in mcsmsic. if the ctm4 wins arbitra- tion, it responds with a vector number generated by concatenating vect[7:6] in biumcr and the six low-order bits specified by the number of the submodule request- ing service. thus, for mcsm12 in ctm4, six low-order bits would be 12 in decimal, or %001100 in binary. 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-10 user? manual 10.7.7 mcsm registers the mcsm contains a status/interrupt/control register, a counter, and a modulus latch. all unused bits and reserved address locations return zero when read. writes to un- used bits and reserved address locations have no effect. the ctm4 contains three mcsms, each with its own set of registers. refer to d.7.8 mcsm status/interrupt/ control registers , d.7.9 mcsm counter registers , and d.7.10 mcsm modulus latch registers for information concerning mcsm register and bit descriptions. 10.8 double-action submodule (dasm) the double-action submodule (dasm) allows two 16-bit input capture or two 16-bit output compare functions to occur automatically without software intervention. the input edge detector can be programmed to trigger the capture function on user- specified edges. the output flip flop can be set by one of the output compare functions, and reset by the other one. interrupt requests can optionally be generated by the input capture and the output compare functions. the user can select one of two incoming time bases for the input capture and output compare functions. six operating modes allow the dasm input capture and output compare functions to perform pulse width measurement, period measurement, single pulse generation, and continuous pulse width modulation, as well as standard input capture and output com- pare. the dasm can also function as a single i/o pin. dasm operating mode is determined by the mode select field (mode[3:0]) in the dasm status/interrupt/control register (dasmsic). table 10-2 shows the different dasm operating modes. the dasm is composed of two timing channels (a and b), an output flip-flop, an input edge detector, some control logic and an interrupt interface. all control and status bits are contained in dasmsic. channel a consists of one 16-bit data register and one 16-bit comparator. to the user, channel b also appears to consist of one 16-bit data register and one 16-bit compar- table 10-2 dasm modes of operation mode[3:0] mode description of mode 0000 dis disabled ?input pin is high impedance; in gives state of input pin 0001 ipwm input pulse width measurement ?capture on leading edge and the trailing edge of an input pulse 0010 ipm input period measurement ?capture two consecutive rising/falling edges 0011 ic input capture ?capture when the designated edge is detected 0100 ocb output compare, flag set on b compare ?generate leading and trailing edges of an output pulse and set the flag 0101 ocab output compare, flag set on a and b compare ?generate leading and trailing edges of an output pulse and set the flag 0110 reserved 0111 reserved 1xxx opwm output pulse width modulation ?generate continuous pwm output with 7, 9, 11, 12, 13, 14, 15, or 16 bits of resolution 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-11 ator, though internally, channel b has two data registers (b1 and b2). dasm operating mode determines which register is software accessible. refer to table 10-3 . register contents are always transferred automatically at the correct time so that the minimum pulse (measured or generated) is just one time base bus count. the a and b data registers are always read/write registers, accessible via the ctm4 submodule bus. the ctm4 has four dasms. figure 10-5 shows a block diagram of the dasm. figure 10-5 dasm block diagram table 10-3 channel b data register access mode data register input capture (ipwm, ipm, ic) registers a and b2 are used to hold the captured values. in these modes, the b1 register is used as a temporary latch for channel b. output compare (oca, ocab) registers a and b2 are used to define the output pulse. register b1 is not used in these modes. output pulse width modulation mode (opwm) registers a and b1 are used as primary registers and hidden register b2 is used as a double buffer for channel b. output buffer interrupt control edge detect ctm dasm block 16-bit comparator a il2 il0 iarb3 flag 2 time base buses bus control register bits control register bits in forcb submodule bus select output flip-flop forca i/o pin 16-bit register a bsl mode3 mode2 il1 tbbb tbba 16-bit register b1 16-bit register b2 mode1 mode0 16-bit comparator b wor edpol register b 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-12 user? manual 10.8.1 dasm interrupts the dasm can optionally request an interrupt when the flag bit in dasmsic is set. to enable interrupts, set the il[2:0] field in dasmsic to a non-zero value. the ctm4 compares the cpu32 ip mask value to the priority of the requested interrupt designat- ed by il[2:0] to determine whether it should contend for arbitration priority. during ar- bitration, the biusm provides the arbitration value specified by iarb[2:0] in biumcr and iarb3 in dasmsic. if the ctm4 wins arbitration, it responds with a vector num- ber generated by concatenating vect[7:6] in biumcr and the six low-order bits specified by the number of the submodule requesting service. thus, for dasm9 in the ctm4, the six low-order bits would be nine in decimal, or %001001 in binary. 10.8.2 dasm registers the dasm contains one status/interrupt/control register and two data registers (a and b). all unused bits and reserved address locations return zero when read. writes to unused bits and reserved address locations have no effect. the ctm4 contains four dasms, each with its own set of registers. refer to d.7.11 dasm status/interrupt/ control registers , d.7.12 dasm data register a , and d.7.13 dasm data register b for information concerning dasm register and bit descriptions. 10.9 pulse-width modulation submodule (pwmsm) the pwmsm allows pulse width modulated signals to be generated over a wide range of frequencies, independently of other ctm4 output signals. the output pulse width duty cycle can vary from 0% to 100%, with 16 bits of resolution. the minimum pulse width is twice the mcu system clock period. for example, the minimum pulse width is 95.4 ns when using a 20.97 mhz clock. the pwmsm is composed of: ?an output flip-flop with output polarity control ?clock prescaler and selection logic ?a 16-bit up-counter ?two registers to hold the current and next pulse width values ?two registers to hold the current and next pulse period values ?a pulse width comparator ?a system state sequencer ?logic to create 0% and 100% pulses ?interrupt logic ?a status, interrupt and control register ?a submodule bus interface the pwmsm includes its own time base counter and does not use the ctm4 time base buses; however, it does use the prescaled clock signal pclk1 generated by the cpsm. refer to 10.5 counter prescaler submodule (cpsm) and figure 10-1 for more information. figure 10-6 shows a block diagram of the pwmsm. 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-13 figure 10-6 pulse-width modulation submodule block diagram 10.9.1 output flip-flop and pin the output flip-flop is the basic output mechanism of the pwmsm. except when the required duty cycle is 0% or 100%, the output flip-flop is set at the beginning of each period and is cleared at the end of the designated pulse width. the polarity of the out- put pulse is user programmable. the output flip-flop is connected to a buffer that drives the pwmsm? associated output pin. the pwmsm is disabled by clearing the en bit in the pwmsm status/interrupt/control register (pwmsic). when the pwmsm is not in use, the output pin can be used as a digital output controlled by the pol bit in pwmsic. 10.9.2 clock selection the pwmsm contains an 8-bit prescaler that is clocked by the pclk1 signal (f sys ? 2 or f sys ? 3) from the cpsm. the clk[2:0] field in pwmsic selects which of the eight prescaler outputs drives the pwmsm counter. refer to table 10-4 for the prescaler output. 16-bit up counter il2 il1 il0 iarb3 il1 state ? 256 prescaler clk1 clk0 clk2 output set submodule bus sequencer buffer (n count ) zero detect control register bits pin 16-bit comparator period register next period register pwma1 pwma2 clock select 16-bit comparator pulse width register next pulse width register pwmb1 pwmb2 output flip-flop interrupt control flag pol load en clear clear all zeros match match load enable pclk1 output pin pwmc pwma pwmb ctm pwm block 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-14 user? manual 10.9.3 pwmsm counter the 16-bit up counter in the pwmsm provides the time base for the pwm output sig- nal. the counter is held in the $0001 state after reset or when the pwmsm is disabled. when the pwmsm is enabled, the counter begins counting at the rate selected by clk[2:0] in pwmsic. each time the counter matches the contents of the period reg- ister, the counter is preset to $0001 and starts to count from that value. the counter can be read at any time from the pwmc register without affecting its value. writing to the counter has no effect. 10.9.4 pwmsm period registers and comparator the period section of the pwmsm consists of two 16-bit period registers (pwma1 and pwma2) and one 16-bit comparator. pwma2 holds the current pwm period value, and pwma1 holds the next pwm period value. the next period of the output pwm signal is established by writing a value into pwma1. pwma2 acts as a double buffer for pwma1, allowing the contents of pwma1 to be changed at any time without af- fecting the period of the current output signal. pwma2 is not user accessible. pwma1 can be read or written at any time. the new value in pwma1 is transferred to pwma2 on the next full cycle of the pwm output or when a one is written to the load bit in pwmsic. the comparator continuously compares the contents of pwma2 with the value in the pwmsm counter. when a match occurs, the state sequencer sets the output flip-flop and resets the counter to $0001. period values $0000 and $0001 are special cases. when pwma2 contains $0000, an output period of 65536 pwm clock periods is generated. when pwma2 contains $0001, a period match occurs on every pwm clock period. the counter never increments beyond $0001, and the output level never changes. note values of $0002 in the period register (pwma2) and $0001 in the pulse width register (pwmb2) result in the maximum possible output frequency for a given pwm counter clock frequency. table 10-4 pwmsm divide by options clk2 clk1 clk0 pclk1 = f sys ? 2 (cpcr div23 = 0) pclk1 = f sys ? 3 (cpcr div23 = 0) 000 f sys ? 2f sys ? 3 001 f sys ? 4f sys ? 6 010 f sys ? 8f sys ? 12 011 f sys ? 16 f sys ? 24 100 f sys ? 32 f sys ? 48 101 f sys ? 64 f sys ? 96 110 f sys ? 128 f sys ? 192 111 f sys ? 512 f sys ? 768 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-15 10.9.5 pwmsm pulse-width registers and comparator the pulse width section of the pwmsm consists of two 16-bit pulse width registers (pwmb1 and pwmb2) and one 16-bit comparator. pwmb2 holds the current pwm pulse width value, and pwmb1 holds the next pwm pulse width value. the next pulse width of the output pwm signal is established by writing a value into pwmb1. pwmb2 acts as a double buffer for pwmb1, allowing the contents of pwmb1 to be changed at any time without affecting the pulse width of the current output signal. pwmb2 is not user accessible. pwmb1 can be read or written at any time. the new value in pwmb1 is transferred to pwmb2 on the next full cycle of the output or when a one is written to the load bit in pwmsic. the comparator continuously compares the contents of pwmb2 with the counter. when a match occurs, the output flip-flop is cleared. this pulse width match completes the pulse width, however, it does not affect the counter. the pwm output pulse may be as short as one pwm counter clock period (pwmb2 = $0001). it may be as long as one pwm clock period less than the pwm period. for example, a pulse width equal to 65535 pwm clock periods can be obtained by setting pwmb2 to $ffff and pwma2 to $0000. 10.9.6 pwmsm coherency access to pwmsm registers can be accomplished with 16-bit transfers in most cases. the pwmsm treats a 32-bit access as two 16-bit accesses, except when the access is a write to the period and pulse width registers. a single long word write can set both pwma1 and pwmb1 because they occupy subsequent memory addresses. if the write can be completed within the current pwm period, there is no visible effect on the output signal. new values loaded into pwma1 and pwmb1 will be transferred into pwma2 and pwmb2 at the start of the next period. if the write coincides with the end of the current pwm period, the transfer of values from pwma1 and pwmb1 into pwma2 and pwmb2 will be suppressed until the end of the next period. this prevents undesired glitches on the output signal. during the period that is output before the sup- pressed transfer completes, the current values in pwma2 and pwmb2 are used. 10.9.7 pwmsm interrupts the flag bit in pwmsic is set when a new pwm period begins and indicates that the period and pulse width registers (pwma1 and pwmb1) may be updated with new values for the next output period. the pwmsm can optionally request an interrupt when flag is set. to enable interrupts, set the il[2:0] field in pwmsic to a non-zero value. the ctm4 compares the cpu32 ip mask value to the priority of the requested interrupt designated by il[2:0] to determine whether it should contend for arbitration priority. during arbitration, the biusm provides the arbitration value specified by iarb[2:0] in biumcr and iarb3 in pwmsic. if the ctm4 wins arbitration, it responds with a vec- tor number generated by concatenating vect[7:6] in biumcr and the six low-order bits specified by the number of the submodule requesting service. thus, for pwmsm8 in the ctm4, the six low-order bits would be eight in decimal, or %00100 in binary. 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-16 user? manual 10.9.8 pwm frequency the relationship between the pwm output frequency (f pwm ) and the mcu system clock frequency (f sys ) is given by the following equation: where n clock is the divide ratio specified by the clk[2:0] field in pwmsic and n period is the period specified by pwma1. the minimum pwm output frequency achievable with a specified number of bits of res- olution for a given system clock frequency is: where n cpsm is the cpsm divide ratio of two or three. similarly, the maximum pwm output frequency achievable with a specified number of bits of resolution for a given system clock frequency is: tables 10-5 and 10-6 summarize the minimum pulse widths and frequency ranges available from the pwmsm based on the cpsm system clock divide ratio and a system clock frequency of 20.97 mhz. table 10-5 pwm pulse and frequency ranges (in hz) using ? 2 option (20.97 mhz) f sys divide ratio minimum pulse width bits of resolution 16151413121110987654321 ? 2 0.095 m s 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k 328k 655k 1311k 2621k 5243k ? 4 0.191 m s 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k 328k 655k 1311k 2621k ? 8 0.381 m s 40 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k 328k 655k 1311k ? 16 0.763 m s 20 40 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k 328k 655k ? 32 1.53 m s 10 20 40 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k 328k ? 64 3.05 m s 5 10 20 40 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 164k ? 128 6.10 m s 2.5 5 10 20 40 80 160 320 640 1280 2560 5120 10239 20479 40957 81914 ? 512 24.42 m s 0.6 1.3 2.5 5 10 20 40 80 160 320 640 1280 2560 5120 10239 20479 table 10-6 pwm pulse and frequency ranges (in hz) using ? 3 option (20.97 mhz) f sys divide ratio minimum pulse width bits of resolution 16151413121110987654321 ? 3 0.179 m s 107 224 427 853 1707 3413 6826 13652 27305 54609 109k 218k 437k 874k 1748k 3495k ? 6 0.358 m s 53 107 224 427 853 1707 3413 6826 13652 27305 54609 109k 218k 437k 874k 1748k ? 12 0.715 m s 27 53 107 224 427 853 1707 3413 6826 13652 27305 54609 109k 218k 437k 874k ? 24 1.431 m s 13 27 53 107 224 427 853 1707 3413 6826 13652 27305 54609 109k 218k 437k ? 48 2.861 m s 7 13 27 53 107 224 427 853 1707 3413 6826 13652 27305 54609 109k 218k ? 96 5.722 m s 3 7 13 27 53 107 224 427 853 1707 3413 6826 13652 27305 54609 109k ? 192 11.44 m s 2 3 7 13 27 53 107 224 427 853 1707 3413 6826 13652 27305 54609 ? 768 45.78 m s 0.4 0.8 2 3 7 13 27 53 107 224 427 853 1707 3413 6826 13652 f pwm f sys n clock n period ----------------------------------------------- = minimum f pwm f sys 256n cpsm 2 bits of resolution ----------------------------------------------------------------------- = maximum f pwm f sys n cpsm 2 bits of resolution ------------------------------------------------------------- = 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 configurable timer module 4 motorola user? manual 10-17 10.9.9 pwm pulse width the shortest output pulse width (t pwmin ) that can be obtained is given by the following equation: the maximum output pulse width (t pwmax ) that can be obtained is given by the follow- ing equation: 10.9.10 pwm period and pulse width register values the value loaded into pwma1 to obtain a given period is: the value loaded into pwmb1 to obtain a given duty cycle is: 10.9.10.1 pwm duty cycle boundary cases pwm duty cycles 0% and 100% are special boundary cases (zero pulse width and in- finite pulse width) that are defined by the ?lways clear?and ?lways set?states of the output flip-flop. a zero width pulse is generated by setting pwmb2 to $0000. the output is a true steady state signal. an infinite width pulse is generated by setting pwmb2 equal to or greater than the period value in pwma2. in both cases, the state of the output pin will remain unchanged at the polarity defined by the pol bit in pwmsic. note a duty cycle of 100% is not possible when the output period is set to 65536 pwm clock periods (which occurs when pwmb2 is set to $0000). in this case, the maximum duty cycle is 99.998% (100 x 65535/65536). even when the duty cycle is 0% or 100%, the pwmsm counter continues to count. 10.9.11 pwmsm registers the pwmsm contains a status/interrupt/control register, a period register, a pulse width register, and a counter register. all unused bits and reserved address locations return zero when read. writes to unused bits and reserved address locations have no effect. the ctm4 contains four pwmsms, each with its own set of registers. refer to t pwmin n clock f sys ------------------- - = t pwmax n clock n period 1 () f sys ------------------------------------------------------------- = pwma1 f sys n clock f pwm ------------------------------------- = pwmb1 1 t pwmin f pwm ---------------------------------- duty cycle % 100 ----------------------------------- - pwma1 == 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola configurable timer module 4 MC68336/376 10-18 user? manual d.7.14 pwm status/interrupt/control register , d.7.15 pwm period register , d.7.16 pwm pulse width register , and d.7.17 pwm counter register for informa- tion concerning pwmsm register and bit descriptions. 10.10 ctm4 interrupts the ctm4 is able to generate as many as eleven requests for interrupt service. each submodule capable of requesting an interrupt can do so on any of seven levels. sub- modules that can request interrupt service have a 3-bit level number and a 1-bit arbi- tration number that is user-initialized. the 3-bit level number selects which of seven interrupt signals on the imb are driven by that submodule to generate an interrupt request. of the four priority bits provided by the imb to the ctm4 for interrupt arbitration, one of them comes from the chosen submodule, and the biusm provides the other three. thus, the ctm4 can respond with two of the 15 possible arbitration numbers. during the imb arbitration process, the biusm manages the separate arbitration among the ctm4 submodules to determine which submodule should respond. the ctm4 has a fixed hardware prioritization scheme for all submodules. when two or more submodules have an interrupt request pending at the level being arbitrated on the imb, the submodule with the lowest number (also the lowest status/interrupt/con- trol register address) is given the highest priority to respond. if the ctm4 wins arbitration, it responds with a vector number generated by concate- nating vect[7:6] in biumcr and the six low-order bits specified by the number of the submodule requesting service. table 10-7 shows the allocation of ctm4 submodule numbers and interrupt vector numbers. notes: 1. y = m111, where m is the state of the mm bit in simcr (y = $7 or $f). 2. ?x?represents vect[7:6] in the biusm module configuration register. table 10-7 ctm4 interrupt priority and vector/pin allocation submodule name submodule number submodule base address submodule binary vector number biusm 0 $yff400 1 none cpsm 1 $yff408 none mcsm2 2 $yff410 xx000010 2 dasm3 3 $yff418 xx000011 dasm4 4 $yff420 xx000100 pwsm5 5 $yff428 xx000101 pwsm6 6 $yff430 xx000110 pwsm7 7 $yff438 xx000111 pwsm8 8 $yff440 xx001000 dasm9 9 $yff448 xx001001 dasm10 10 $yff450 xx001010 mcsm11 11 $yff458 xx001011 fcsm12 12 $yff460 xx001100 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-1 section 11 time processor unit the time processor unit (tpu) is an intelligent, semi-autonomous microcontroller de- signed for timing control. operating simultaneously with the cpu32, the tpu sched- ules tasks, processes microcode rom instructions, accesses shared data with the cpu32, and performs input and output functions. figure 11-1 is a simplified block di- agram of the tpu. figure 11-1 tpu block diagram 11.1 general the tpu can be viewed as a special-purpose microcomputer that performs a pro- grammable series of two operations, match and capture. each occurrence of either operation is called an event. a programmed series of events is called a function. tpu functions replace software functions that would require cpu32 interrupt service. two sets of microcode rom functions are currently available for most mcu derivatives with the tpu. the a mask set (or original mask set) includes the following functions: ?discrete input/output ?input capture/input transition counter ?output compare ?pulse width modulation tpu block pins service requests data tcr1 tcr2 microengine control store execution unit i m b host interface parameter ram channel control development support and test system configuration scheduler control and data control timer channels channel 0 channel 1 channel 15 channel data t2clk pin 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-2 user? manual ?synchronized pulse width modulation ?period measurement with additional transition detect ?period measurement with missing transition detect ?position-synchronized pulse generator ?stepper motor ?period/pulse width accumulator ?quadrature decode the g mask set (or motion control mask set) includes the following functions: ?table stepper motor ?new input capture/transition counter ?queued output match ?programmable time accumulator ?multichannel pulse width modulation ?fast quadrature decode ?universal asynchronous receiver/transmitter ?brushless motor communication ?frequency measurement ?hall effect decode 11.2 tpu components the tpu consists of two 16-bit time bases, sixteen independent timer channels, a task scheduler, a microengine, and a host interface. in addition, a dual-ported parameter ram is used to pass parameters between the module and the cpu32. 11.2.1 time bases two 16-bit counters provide reference time bases for all output compare and input capture events. prescalers for both time bases are controlled by the cpu32 via bit fields in the tpu module configuration register (tpumcr). timer count registers tcr1 and tcr2 provide access to the current counter values. tcr1 and tcr2 can be read by tpu microcode, but are not directly available to the cpu32. the tcr1 clock is derived from the system clock. the tcr2 clock can be derived from the sys- tem clock or from an external clock input via the t2clk pin. 11.2.2 timer channels the tpu has 16 independent channels, each connected to an mcu pin. the channels have identical hardware. each channel consists of an event register and pin control logic. the event register contains a 16-bit capture register, a 16-bit compare/match register, and a 16-bit greater-than-or-equal-to comparator. the direction of each pin, either output or input, is determined by the tpu microengine. each channel can either use the same time base for match and capture, or can use one time base for match and the other for capture. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-3 11.2.3 scheduler when a service request is received, the scheduler determines which tpu channel is serviced by the microengine. a channel can request service for one of four reasons: for host service, for a link to another channel, for a match event, or for a capture event. the host system assigns each active channel one of three priorities: high, middle, or low. when multiple service requests are received simultaneously, a priority-scheduling mechanism grants service based on channel number and assigned priority. 11.2.4 microengine the microengine is composed of a control store and an execution unit. control-store rom holds the microcode for each factory-masked time function. when assigned to a channel by the scheduler, the execution unit executes microcode for a function as- signed to that channel by the cpu32. microcode can also be executed from the tpuram module instead of the control store. the tpuram allows emulation and de- velopment of custom tpu microcode without the generation of a microcode rom mask. refer to 11.3.6 emulation support for more information. 11.2.5 host interface the host interface registers allow communication between the cpu32 and the tpu, both before and during execution of a time function. the registers are accessible from the imb through the tpu bus interface unit. refer to 11.6 host interface registers and d.8 time processor unit (tpu) for register bit/field definitions and address map- ping. 11.2.6 parameter ram parameter ram occupies 256 bytes at the top of the system address map. channel parameters are organized as 128 16-bit words. although all parameter word locations in ram can be accessed by all channels, only 100 are normally used: channels 0 to 13 use six parameter words, while channels 14 and 15 each use eight parameter words. the parameter ram address map in d.8.15 tpu parameter ram shows how parameter words are organized in memory. the cpu32 specifies function parameters by writing to the appropriate ram address. the tpu reads the ram to determine channel operation. the tpu can also store in- formation to be read by the cpu32 in the parameter ram. detailed descriptions of the parameters required by each time function are beyond the scope of this manual. refer to the tpu reference manual (tpurm/ad) and the motorola tpu literature package (tpulitpak/d) for more information. 11.3 tpu operation all tpu functions are related to one of the two 16-bit time bases. functions are syn- thesized by combining sequences of match events and capture events. because the primitives are implemented in hardware, the tpu can determine precisely when a match or capture event occurs, and respond rapidly. an event register for each chan- nel provides for simultaneity of match/capture event occurrences on all channels. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-4 user? manual when a match or input capture event requiring service occurs, the affected channel generates a service request to the scheduler. the scheduler determines the priority of the request and assigns the channel to the microengine at the first available time. the microengine performs the function defined by the content of the control store or emu- lation ram, using parameters from the parameter ram. 11.3.1 event timing match and capture events are handled by independent channel hardware. this pro- vides an event accuracy of one time-base clock period, regardless of the number of channels that are active. an event normally causes a channel to request service. the time needed to respond to and service an event is determined by which channels and the number of channels requesting service, the relative priorities of the channels re- questing service, and the microcode execution time of the active functions. worst- case event service time (latency) determines tpu performance in a given application. latency can be closely estimated. for more information, refer to the tpu reference manual (tpurm/ad) 11.3.2 channel orthogonality most timer systems are limited by the fixed number of functions assigned to each pin. all tpu channels contain identical hardware and are functionally equivalent in opera- tion, so that any channel can be configured to perform any time function. any function can operate on the calling channel, and, under program control, on another channel determined by the program or by a parameter. the user controls the combination of time functions. 11.3.3 interchannel communication the autonomy of the tpu is enhanced by the ability of a channel to affect the opera- tion of one or more other channels without cpu32 intervention. interchannel commu- nication can be accomplished by issuing a link service request to another channel, by controlling another channel directly, or by accessing the parameter ram of another channel. 11.3.4 programmable channel service priority the tpu provides a programmable service priority level to each channel. three prior- ity levels are available. when more than one channel of a given priority requests ser- vice at the same time, arbitration is accomplished according to channel number. to prevent a single high-priority channel from permanently blocking other functions, other service requests of the same priority are performed in channel order after the lowest- numbered, highest-priority channel is serviced. 11.3.5 coherency for data to be coherent, all available portions of the data must be identical in age, or must be logically related. as an example, consider a 32-bit counter value that is read and written as two 16-bit words. the 32-bit value is read-coherent only if both 16-bit portions are updated at the same time, and write-coherent only if both portions take 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-5 effect at the same time. parameter ram hardware supports coherent access of two adjacent 16-bit parameters. the host cpu must use a long-word operation to guaran- tee coherency. 11.3.6 emulation support although factory-programmed time functions can perform a wide variety of control tasks, they may not be ideal for all applications. the tpu provides emulation capability that allows the user to develop new time functions. emulation mode is entered by set- ting the emu bit in tpumcr. in emulation mode, an auxiliary bus connection is made between tpuram and the tpu, and access to tpuram via the intermodule bus is disabled. a 9-bit address bus, a 32-bit data bus, and control lines transfer information between the modules. to ensure exact emulation, ram module access timing re- mains consistent with access timing of the tpu microcode rom control store. to support changing tpu application requirements, motorola has established a tpu function library. the function library is a collection of tpu functions written for easy assembly in combination with each other or with custom functions. refer to motorola programming note tpupn00/d, using the tpu function library and tpu emulation mode for information about developing custom functions and accessing the tpu func- tion library. refer to the tpu reference manual (tpurm/ad) and the motorola tpu literature package (tpulitpak/d) for more information about specific functions. 11.3.7 tpu interrupts each of the tpu channels can generate an interrupt service request. interrupts for each channel must be enabled by writing to the appropriate control bit in the channel interrupt enable register (cier). the channel interrupt status register (cisr) contains one interrupt status flag per channel. time functions set the flags. setting a flag bit causes the tpu to make an interrupt service request if the corresponding channel in- terrupt enable bit is set and the interrupt request level is non-zero. the value of the channel interrupt request level (cirl) field in the tpu interrupt configuration register (ticr) determines the priority of all tpu interrupt service re- quests. cirl values correspond to mcu interrupt request signals irq[7:1] . irq7 is the highest-priority request signal; irq1 has the lowest priority. assigning a value of %111 to cirl causes irq7 to be asserted when a tpu interrupt request is made; lower field values cause corresponding lower-priority interrupt request signals to be asserted. assigning cirl a value of %000 disables all interrupts. the cpu32 recognizes only interrupt requests of a priority greater than the value contained in the interrupt priority (ip) mask in the status register. when the cpu32 acknowledges an interrupt request, the priority of the acknowledged interrupt is written to the ip mask and is driven out onto the imb address lines. when the ip mask value driven out on the address lines is the same as the cirl value, the tpu contends for arbitration priority. the iarb field in tpumcr contains the tpu arbitration number. each module that can make an interrupt service request must be assigned a unique non-zero iarb value in order to implement an arbitration scheme. 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-6 user? manual arbitration is performed by means of serial assertion of iarb field bit values. the iarb of tpumcr is initialized to $0 during reset. when the tpu wins arbitration, it must respond to the cpu32 interrupt acknowledge cycle by placing an interrupt vector number on the data bus. the vector number is used to calculate displacement into the exception vector table. vectors are formed by concatenating the 4-bit value of the cibv field in ticr with the 4-bit number of the channel requesting interrupt service. since the cibv field has a reset value of $0, it must be assigned a value corresponding to the upper nibble of a block of 16 user-de- fined vector numbers before tpu interrupts are enabled. otherwise, a tpu interrupt service request could cause the cpu32 to take one of the reserved vectors in the exception vector table. for more information about the exception vector table, refer to 4.9 exception pro- cessing . refer to 5.8 interrupts for further information about interrupts. 11.4 a mask set time functions the following paragraphs describe factory-programmed time functions implemented in the a mask set tpu microcode rom. a complete description of the functions is be- yond the scope of this manual. refer to the tpu reference manual (tpurm/ad) for additional information. 11.4.1 discrete input/output (dio) when a pin is used as a discrete input, a parameter indicates the current input level and the previous 15 levels of a pin. bit 15, the most significant bit of the parameter, indicates the most recent state. bit 14 indicates the next most recent state, and so on. the programmer can choose one of the three following conditions to update the pa- rameter: 1) when a transition occurs, 2) when the cpu32 makes a request, or 3) when a rate specified in another parameter is matched. when a pin is used as a discrete out- put, it is set high or low only upon request by the cpu32. refer to tpu programming note discrete input/output (dio) tpu function (tpupn18/d) for more information. 11.4.2 input capture/input transition counter (itc) any channel of the tpu can capture the value of a specified tcr upon the occurrence of each transition or specified number of transitions and then generate an interrupt re- quest to notify the cpu32. a channel can perform input captures continually, or a channel can detect a single transition or specified number of transitions, then cease channel activity until reinitialization. after each transition or specified number of tran- sitions, the channel can generate a link to a sequential block of up to eight channels. the user specifies a starting channel of the block and the number of channels within the block. the generation of links depends on the mode of operation. in addition, after each transition or specified number of transitions, one byte of the parameter ram (at an address specified by channel parameter) can be incremented and used as a flag to notify another channel of a transition. 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-7 refer to tpu programming note input capture/input transition counter (itc) tpu function (tpupn16/d) for more information. 11.4.3 output compare (oc) the output compare function generates a rising edge, a falling edge, or a toggle of the previous edge in one of three ways: 1. immediately upon cpu32 initiation, thereby generating a pulse with a length equal to a programmable delay time. 2. at a programmable delay time from a user-specified time. 3. as a continuous square wave. upon receiving a link from a channel, oc refer- ences, without cpu32 interaction, a specifiable period and calculates an offset: where ?atio?is a parameter supplied by the user. this algorithm generates a 50% duty-cycle continuous square wave with each high/ low time equal to the calculated offset. due to offset calculation, there is an initial link time before continuous pulse generation begins. refer to tpu programming note output compare (oc) tpu function (tpupn12/d) for more information. 11.4.4 pulse-width modulation (pwm) the tpu can generate a pulse-width modulated waveform with any duty cycle from zero to 100% (within the resolution and latency capability of the tpu). to define the pwm, the cpu32 provides one parameter that indicates the period and another pa- rameter that indicates the high time. updates to one or both of these parameters can direct the waveform change to take effect immediately, or coherently beginning at the next low-to-high transition of the pin. refer to tpu programming note pulse-width modulation (pwm) tpu function (tpupn17/d) for more information. 11.4.5 synchronized pulse-width modulation (spwm) the tpu generates a pwm waveform in which the cpu32 can change the period and/ or high time at any time. when synchronized to a time function on a second channel, the synchronized pwm low-to-high transitions have a time relationship to transitions on the second channel. refer to tpu programming note synchronized pulse-width modulation (spwm) tpu function (tpupn19/d) for more information. offset period ratio = 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-8 user? manual 11.4.6 period measurement with additional transition detect (pma) this function and the following function are used primarily in toothed-wheel speed- sensing applications, such as monitoring rotational speed of an engine. the period measurement with additional transition detect function allows for a special-purpose 23-bit period measurement. it can detect the occurrence of an additional transition (caused by an extra tooth on the sensed wheel) indicated by a period measurement that is less than a programmable ratio of the previous period measurement. once detected, this condition can be counted and compared to a programmable num- ber of additional transitions detected before tcr2 is reset to $ffff. alternatively, a byte at an address specified by a channel parameter can be read and used as a flag. a non-zero value of the flag indicates that tcr2 is to be reset to $ffff once the next additional transition is detected. refer to tpu programming note period measurement, additional transition detect (pma) tpu function (tpupn15a/d) for more information. 11.4.7 period measurement with missing transition detect (pmm) period measurement with missing transition detect allows a special-purpose 23-bit pe- riod measurement. it detects the occurrence of a missing transition (caused by a miss- ing tooth on the sensed wheel), indicated by a period measurement that is greater than a programmable ratio of the previous period measurement. once detected, this con- dition can be counted and compared to a programmable number of additional transi- tions detected before tcr2 is reset to $ffff. in addition, one byte at an address specified by a channel parameter can be read and used as a flag. a non-zero value of the flag indicates that tcr2 is to be reset to $ffff once the next missing transition is detected. refer to tpu programming note period measurement, missing transition detect (pmm) tpu function (tpupn15b/d) for more information. 11.4.8 position-synchronized pulse generator (psp) any channel of the tpu can generate an output transition or pulse, which is a projec- tion in time based on a reference period previously calculated on another channel. both tcrs are used in this algorithm: tcr1 is internally clocked, and tcr2 is clocked by a position indicator in the user's device. an example of a tcr2 clock source is a sensor that detects special teeth on the flywheel of an automobile using pma or pmm. the teeth are placed at known degrees of engine rotation; hence, tcr2 is a coarse representation of engine degrees. for example, each count represents some number of degrees. up to 15 position-synchronized pulse generator function channels can operate with a single input reference channel executing a pma or pmm input function. the input channel measures and stores the time period between the flywheel teeth and resets tcr2 when the engine reaches a reference position. the output channel uses the pe- riod calculated by the input channel to project output transitions at specific engine de- grees. because the flywheel teeth might be 30 or more degrees apart, a fractional 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-9 multiplication operation resolves down to the desired degrees. two modes of opera- tion allow pulse length to be determined either by angular position or by time. refer to tpu programming note position-synchronized pulse generator (psp) tpu function (tpupn14/d) for more information. 11.4.9 stepper motor (sm) the stepper motor control algorithm provides for linear acceleration and deceleration control of a stepper motor with a programmable number of step rates of up to 14. any group of channels, up to eight, can be programmed to generate the control logic nec- essary to drive a stepper motor. the time period between steps (p) is defined as: where r is the current step rate (1?4), and k1 and k2 are supplied as parameters. after providing the desired step position in a 16-bit parameter, the cpu32 issues a step request. next, the tpu steps the motor to the desired position through an accel- eration/deceleration profile defined by parameters. the parameter indicating the de- sired position can be changed by the cpu32 while the tpu is stepping the motor. this algorithm changes the control state every time a new step command is received. a 16-bit parameter initialized by the cpu32 for each channel defines the output state of the associated pin. the bit pattern written by the cpu32 defines the method of step- ping, such as full stepping or half stepping. with each transition, the 16-bit parameter rotates one bit. the period of each transition is defined by the programmed step rate. refer to tpu programming note stepper motor (sm) tpu function (tpupn13/d) for more information. 11.4.10 period/pulse-width accumulator (ppwa) the period/pulse-width accumulator algorithm accumulates a 16-bit or 24-bit sum of either the period or the pulse width of an input signal over a programmable number of periods or pulses (from one to 255). after an accumulation period, the algorithm can generate a link to a sequential block of up to eight channels. the user specifies a start- ing channel of the block and number of channels within the block. generation of links depends on the mode of operation. any channel can be used to measure an accumu- lated number of periods of an input signal. a maximum of 24 bits can be used for the accumulation parameter. from one to 255 period measurements can be made and summed with the previous measurement(s) before the tpu interrupts the cpu, allow- ing instantaneous or average frequency measurement, and the latest complete accu- mulation (over the programmed number of periods). the pulse width (high-time portion) of an input signal can be measured (up to 24 bits) and added to a previous measurement over a programmable number of periods (one pr () k1 k2 r = 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-10 user? manual to 255). this provides an instantaneous or average pulse-width measurement capa- bility, allowing the latest complete accumulation (over the specified number of periods) to always be available in a parameter. by using the output compare function in con- junction with ppwa, an output signal can be generated that is proportional to a spec- ified input signal. the ratio of the input and output frequency is programmable. one or more output signals with different frequencies, yet proportional and synchronized to a single input signal, can be generated on separate channels. refer to tpu programming note period/pulse-width accumulator (ppwa) tpu func- tion (tpupn11/d) for more information. 11.4.11 quadrature decode (qdec) the quadrature decode function uses two channels to decode a pair of out-of-phase signals in order to present the cpu32 with directional information and a position value. it is particularly suitable for use with slotted encoders employed in motor control. the function derives full resolution from the encoder signals and provides a 16-bit position counter with rollover/under indication via an interrupt. the counter in parameter ram is updated when a valid transition is detected on either one of the two inputs. the counter is incremented or decremented depending on the lead/lag relationship of the two signals at the time of servicing the transition. the user can read or write the counter at any time. the counter is free running, overflowing to $0000 or underflowing to $ffff depending on direction. the qdec function also provides a time stamp referenced to tcr1 for every valid sig- nal edge and the ability for the host cpu to obtain the latest tcr1 value. this feature allows position interpolation by the host cpu between counts at very slow count rates. refer to tpu programming note quadrature decode (qdec) tpu function (tpupn20/d) for more information. 11.5 g mask set time functions the following paragraphs describe factory-programmed time functions implemented in the motion control microcode rom. a complete description of the functions is be- yond the scope of this manual. refer to the tpu reference manual (tpurm/ad) for additional information. 11.5.1 table stepper motor (tsm) the tsm function provides for acceleration and deceleration control of a stepper mo- tor with a programmable number of step rates up to 58. tsm uses a table in parameter ram, rather than an algorithm, to define the stepper motor acceleration profile, allow- ing the user to fully define the profile. in addition, a slew rate parameter allows fine control of the terminal running speed of the motor independent of the acceleration ta- ble. the cpu need only write a desired position, and the tpu accelerates, slews, and decelerates the motor to the required position. full and half step support is provided for two-phase motors. in addition, a slew rate parameter allows fine control of the ter- minal running speed of the motor independent of the acceleration table. 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-11 refer to tpu programming note table stepper motor (tsm) tpu function (tpupn04/d) for more information. 11.5.2 new input capture/transition counter (nitc) any channel of the tpu can capture the value of a specified tcr or any specified lo- cation in parameter ram upon the occurrence of each transition or specified number of transitions, and then generate an interrupt request to notify the cpu32. the times of the most recent two transitions are maintained in parameter ram. a channel can perform input captures continually, or a channel can detect a single transition or spec- ified number of transitions, ceasing channel activity until reinitialization. after each transition or specified number of transitions, the channel can generate a link to other channels. refer to tpu programming note new input capture/transition counter (nitc) tpu function (tpupn08/d) for more information. 11.5.3 queued output match (qom) qom can generate single or multiple output match events from a table of offsets in pa- rameter ram. loop modes allow complex pulse trains to be generated once, a spec- ified number of times, or continuously. the function can be triggered by a link from another tpu channel. in addition, the reference time for the sequence of matches can be obtained from another channel. qom can generate pulse width modulated wave- forms, including waveforms with high times of 0% or 100%. qom also allows a tpu channel to be used as a discrete output pin. refer to tpu programming note queued output match (qom) tpu function (tpupn01/d) for more information. 11.5.4 programmable time accumulator (pta) pta accumulates a 32-bit sum of the total high time, low time, or period of an input signal over a programmable number of periods or pulses. the accumulation can start on a rising or falling edge. after the specified number of periods or pulses, pta generates an interrupt request and optionally generates links to other channels. from one to 255 period measurements can be made and summed with the previous measurement(s) before the tpu interrupts the cpu32, providing instantaneous or average frequency measurement capability, and the latest complete accumulation (over the programmed number of periods). refer to tpu programming note programmable time accumulator (pta) tpu func- tion (tpupn06/d) for more information. 11.5.5 multichannel pulse-width modulation (mcpwm) mcpwm generates pulse-width modulated outputs with full 0% to 100% duty cycle range independent of other tpu activity. this capability requires two tpu channels plus an external gate for one pwm channel. (a simple one-channel pwm capability is supported by the qom function.) 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-12 user? manual multiple pwms generated by mcpwm have two types of high time alignment: edge aligned and center aligned. edge aligned mode uses n + 1 tpu channels for n pwms; center aligned mode uses 2n + 1 channels. center aligned mode allows a user-defined ?ead time?to be specified so that two pwms can be used to drive an h-bridge without destructive current spikes. this feature is important for motor control applications. refer to tpu programming note multichannel pulse-width modulation (mcpwm) tpu function (tpupn05/d) for more information. 11.5.6 fast quadrature decode (fqd) fqd is a position feedback function for motor control. it decodes the two signals from a slotted encoder to provide the cpu32 with a 16-bit free running position counter. fqd incorporates a ?peed switch?which disables one of the channels at high speed, allowing faster signals to be decoded. a time stamp is provided on every counter up- date to allow position interpolation and better velocity determination at low speed or when low resolution encoders are used. the third index channel provided by some en- coders is handled by the nitc function. refer to tpu programming note fast quadrature decode (fqd) tpu function (tpupn02/d) for more information. 11.5.7 universal asynchronous receiver/transmitter (uart) the uart function uses one or two tpu channels to provide asynchronous serial communication. data word length is programmable from one to 14 bits. the function supports detection or generation of even, odd, and no parity. baud rate is freely pro- grammable and can be higher than 100 kbaud. eight bidirectional uart channels running in excess of 9600 baud can be implemented. refer to tpu programming note universal asynchronous receiver/transmitter (uart) tpu function (tpupn07/d) for more information. 11.5.8 brushless motor commutation (comm) this function generates the phase commutation signals for a variety of brushless mo- tors, including three-phase brushless dc motors. it derives the commutation state di- rectly from the position decoded in fqd, thus eliminating the need for hall effect sensors. the state sequence is implemented as a user-configurable state machine, thus providing a flexible approach with other general applications. an offset parameter is provided to allow all the switching angles to be advanced or retarded on the fly by the cpu32. this feature is useful for torque maintenance at high speeds. refer to tpu programming note brushless motor commutation (comm) tpu func- tion (tpupn09/d) for more information. 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-13 11.5.9 frequency measurement (fqm) fqm counts the number of input pulses to a tpu channel during a user-defined win- dow period. the function has single shot and continuous modes. no pulses are lost between sample windows in continuous mode. the user selects whether to detect pulses on the rising or falling edge. this function is intended for high speed measure- ment; measurement of slow pulses with noise rejection can be made with pta. refer to tpu programming note frequency measurement (fqm) tpu function (tpupn03/d) for more information. 11.5.10 hall effect decode (halld) this function decodes the sensor signals from a brushless motor, along with a direc- tion input from the cpu32, into a state number. the function supports two- or three- sensor decoding. the decoded state number is written into a comm channel, which outputs the required commutation drive signals. in addition to brushless motor appli- cations, the function can have more general applications, such as decoding option switches. refer to tpu programming note hall effect decode (halld) tpu function (tpupn10/d) for more information. 11.6 host interface registers the tpu memory map contains three groups of registers: ?system configuration registers ?channel control and status registers ?development support and test verification registers all registers except the channel interrupt status register (cisr) must be read or written by means of word accesses. the address space of the tpu memory map occupies 512 bytes. unused registers within the 512-byte address space return zeros when read. 11.6.1 system configuration registers the tpu configuration control registers, tpumcr and ticr, determine the value of the prescaler, perform emulation control, specify whether the external tcr2 pin func- tions as a clock source or as gate of the div8 clock for tcr2, and determine interrupt request level and interrupt vector number assignment. refer to d.8.1 tpu module configuration register and d.8.5 tpu interrupt configuration register for more information about tpumcr and ticr. 11.6.1.1 prescaler control for tcr1 timer count register one (tcr1) is clocked from the output of a prescaler. two fields in tpumcr control tcr1. the prescaler's input is the internal tpu system clock divided by either 4 or 32, depending on the value of the psck bit. the prescaler divides this input by 1, 2, 4, or 8, depending on the value of tcr1p. channels using 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-14 user? manual tcr1 have the capability to resolve down to the tpu system clock divided by 4. refer to figure 11-2 and table 11-1 . figure 11-2 tcr1 prescaler control 11.6.1.2 prescaler control for tcr2 timer count register two (tcr2), like tcr1, is clocked from the output of a prescaler. the t2cg bit in tpumcr determines whether the t2clk pin functions as an external clock source for tcr2 or as the gate in the use of tcr2 as a gated pulse accumulator. the function of the t2cg bit is shown in figure 11-3 . figure 11-3 tcr2 prescaler control table 11-1 tcr1 prescaler control psck = 0 psck = 1 tcr1 prescaler divide by number of clocks rate at 20.97 mhz number of clocks rate at 20.97 mhz 00 1 32 1.6 m s 4 200 ns 01 2 64 3.2 m s 8 400 ns 10 4 128 6.4 m s 16 0.8 m s 11 8 256 12.8 m s 32 1.6 m s tpu pre block 1 tcr1 015 4 div4 clock 32 div32 clock tcr1 prescaler 00 1 01 2 10 4 11 8 system clock 1 ?div4 0 ?div32 psck mux tpu pre block 2 synchronizer div8 clk 0 ?a 1 ?b t2cg control bit tcr2 15 0 tcr2 prescaler 00 1 01 2 10 4 11 8 t2clk pin digital filter a b mux control 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-15 when t2cg is set, the external tcr2 pin functions as a gate of the div8 clock (the tpu system clock divided by eight). in this case, when the external tcr2 pin is low, the div8 clock is blocked, preventing it from incrementing tcr2. when the external tcr2 pin is high, tcr2 is incremented at the frequency of the div8 clock. when t2cg is cleared, an external clock from the tcr2 pin, which has been synchronized and fed through a digital filter, increments tcr2. the tcr2 field in tpumcr specifies the value of the prescaler: 1, 2, 4, or 8. channels using tcr2 have the capability to resolve down to the tpu system clock divided by eight. table 11-2 is a summary of prescaler output. 11.6.1.3 emulation control asserting the emu bit in tpumcr places the tpu in emulation mode. in emulation mode, the tpu executes microinstructions from tpuram exclusively. access to the tpuram module through the imb is blocked, and the tpuram module is dedicated for use by the tpu. after reset, emu can be written only once. 11.6.1.4 low-power stop control if the stop bit in tpumcr is set, the tpu shuts down its internal clocks, shutting down the internal microengine. tcr1 and tcr2 cease to increment and retain the last value before the stop condition was entered. the tpu asserts the stop flag (stf) in tpumcr to indicate that it has stopped. 11.6.2 channel control registers the channel control and status registers enable the tpu to control channel interrupts, assign time functions to be executed on a specified channel, or select the mode of op- eration or the type of host service request for the time function specified. refer to ta- ble 11-4 . 11.6.2.1 channel interrupt enable and status registers the channel interrupt enable register (cier) allows the cpu32 to enable or disable the ability of individual tpu channels to request interrupt service. setting the appro- priate bit in the register enables a channel to make an interrupt service request; clear- ing a bit disables the interrupt. the channel interrupt status register (cisr) contains one interrupt status flag per channel. time functions specify via microcode when an interrupt flag is set. setting a flag causes the tpu to make an interrupt service request if the corresponding cier table 11-2 tcr2 prescaler control tcr2 prescaler divide by internal clock divided by external clock divided by 00 1 8 1 01 2 16 2 10 4 32 4 11 8 64 8 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-16 user? manual bit is set and the cirl field has a non-zero value. to clear a status flag, read cisr, then write a zero to the appropriate bit. cisr is the only tpu register that can be ac- cessed on a byte basis. 11.6.2.2 channel function select registers encoded 4-bit fields within the channel function select registers specify one of 16 time functions to be executed on the corresponding channel. encodings for predefined functions in the tpu rom are found in table 11-3 . 11.6.2.3 host sequence registers the host sequence field selects the mode of operation for the time function selected on a given channel. the meaning of the host sequence bits depends on the time func- tion specified. refer to table 11-4 , which is a summary of the host sequence and host service request bits for each time function. refer to the tpu reference manual (tpurm/ad) and the motorola tpu literature package (tpulitpak/d) for more information. table 11-3 tpu function encodings a mask set g mask set function name function code function name function code ppwa period/pulse width accumulator $f pta programmable time ac- cumulator $f oc output compare $e qom queued output match $e sm stepper motor $d tsm table stepper motor $d psp position-synchronized pulse generator $c fqm frequency measurement $c pma/pmm period measurement with additional/missing transition detect $b uart universal asynchronous receiver/transmitter $b itc input capture/input tran- sition counter $a nitc new input transition counter $a pwm pulse width modulation $9 comm multiphase motor commutation $9 dio discrete input/output $8 halld hall effect decode $8 spwm synchronized pulse width modulation $7 qdec quadrature decode $6 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 time processor unit motorola user? manual 11-17 11.6.2.4 host service registers the host service request field selects the type of host service request for the time func- tion selected on a given channel. the meaning of the host service request bits is de- termined by time function microcode. refer to the tpu reference manual (tpurm/ ad) and the motorola tpu literature package (tpulitpak/d) for more information. a host service request field of %00 signals the cpu that service is completed and that there are no further pending host service requests. the host can request service on a channel by writing the corresponding host service request field to one of three non- zero states. it is imperative for the cpu to monitor the host service request register and wait until the tpu clears the service request for a channel before changing any parameters or issuing a new service request to the channel. 11.6.2.5 channel priority registers the channel priority registers (cpr1, cpr2) assign one of three priority levels to a channel or disable the channel. table 11-4 indicates the number of time slots guaran- teed for each channel priority encoding. 11.6.3 development support and test registers these registers are used for custom microcode development or for factory test. de- scribing the use of these registers is beyond the scope of this manual. register de- scriptions are provided in d.8 time processor unit (tpu) . refer to the tpu reference manual (tpurm/ad) for more information. table 11-4 channel priority encodings chx[1:0] service guaranteed time slots 00 disabled 01 low 1 out of 7 10 middle 2 out of 7 11 high 4 out of 7 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola time processor unit MC68336/376 11-18 user? manual 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 standby ram with tpu emulation motorola user? manual 12-1 section 12 standby ram with tpu emulation the standby ram module with tpu emulation capability (tpuram) consists of a control register block and a 3.5-kbyte array of fast (two system clock) static ram, which is especially useful for system stacks and variable storage. the tpuram re- sponds to both program and data space accesses. the tpuram can also be used to emulate tpu microcode rom. 12.1 general the tpuram can be mapped to the lower 3.5 kbytes of any 4-kbyte boundary in the address map, but must not overlap the module control registers as overlap makes the registers inaccessible. data can be read or written in bytes, words or long words. the tpuram is powered by v dd in normal operation. during power-down, tpuram con- tents can be maintained by power from the v stby input. power switching between sources is automatic. 12.2 tpuram register block there are three tpuram control registers: the tpuram module configuration regis- ter (trammcr), the tpuram test register (tramtst), and the tpuram base ad- dress and status register (trambar). to protect these registers from accidental modification, they are always mapped to supervisor data space. the tpuram control register block begins at address $7ffb00 or $fffb00, depend- ing on the value of the module mapping (mm) bit in the sim configuration register (simcr). refer to 5.2.1 module mapping for more information on how the state of mm affects the system. the tpuram control register block occupies eight bytes of address space. unimple- mented register addresses are read as zeros, and writes have no effect. refer to d.9 standby ram module with tpu emulation capability (tpuram) for register block address map and register bit/field definitions. 12.3 tpuram array address mapping the base address and status register trambar specifies the tpuram array base address in the mcu memory map. trambar[15:4] specify the 12 high-order bits of the base address. the tpu bus interface unit compares these bits to address lines addr[23:12]. if the two match, then the low order address lines and the siz[1:0] sig- nals are used to access the ram location in the array. the ram disable (ramds) bit, the lsb of trambar, indicates whether the tpuram array is active (ramds = 0) or disabled (ramds = 1). the array is disabled coming out of reset and remains disabled if the base address field is programmed with an address that overlaps the address of the module control register block. writing a valid base address to trambar[15:4] clears ramds and enables the array. 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola standby ram with tpu emulation MC68336/376 12-2 user? manual trambar can be written only once after a reset. this prevents runaway software from accidentally re-mapping the array. because the locking mechanism is activated by the first write after a reset, the base address field should be written in a single word operation. writing only one-half of the register prevents the other half from being written. 12.4 tpuram privilege level the rasp field in trammcr specifies whether access to the tpuram can be made from supervisor mode only, or from either user or supervisor mode. if supervisor-only access is specified, an access from user mode is ignored by the tpuram control logic and can be decoded externally. refer to 4.7 privilege levels and 5.5.1.7 function codes for more information concerning privilege levels. 12.5 normal operation during normal operation, the tpuram control registers and array can be accessed by the cpu32, by byte, word, or long word. a byte or aligned word access takes one bus cycle (two system clock cycles). a long word access requires two bus cycles. misaligned accesses are not permitted by the cpu32 and will result in an address error exception. refer to 5.6 bus operation for more information concerning access times. the tpu cannot access the array and has no effect on the operation of the tpuram during normal operation. 12.6 standby operation standby mode maintains the ram array when the mcu main power supply is turned off. relative voltage levels of the v dd and v stby pins determine whether the tpuram is in standby mode. tpuram circuitry switches to the standby power source when spec- ified limits are exceeded. the tpuram is essentially powered by the power supply pin with the greatest voltage (for example, v dd or v stby ). if specified standby supply voltage levels are maintained during the transition, there is no loss of memory when switching occurs. the ram array cannot be accessed while the tpuram is powered from v stby . if standby operation is not desired, connect the v stby pin to the v ss pin. i sb (sram standby current) may exceed specified maximum standby current during the time v dd makes the transition from normal operating level to the level specified for standby operation. this occurs within the voltage range v sb ? 0.5 v 3 v dd 3 v ss + 0.5 v. typically, i sb peaks when v dd ? v sb ?1.5 v, and averages 1.0 ma over the tran- sition period. refer to appendix a electrical characteristics for standby switching and power consumption specifications. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 standby ram with tpu emulation motorola user? manual 12-3 12.7 low-power stop operation setting the stop bit in trammcr places the tpuram in low-power stop mode. in low-power stop mode, the array retains its contents, but cannot be read or written by the cpu32. stop can be written only when the processor is operating in supervisor mode. stop is set during resets. low-power stop mode is exited by clearing stop. the tpuram module will switch to standby mode while it is in low-power mode, pro- vided the operating constraints discussed above are met. 12.8 reset reset places the tpuram in low-power stop mode, enables supervisor mode access only, clears the base address register, and disables the array. these actions make it possible to write a new base address into the base address register. when a synchronous reset occurs while a byte or word tpuram access is in progress, the access is completed. if reset occurs during the first word access of a long-word operation, only the first word access is completed. if reset occurs during the second word access of a long-word operation, the entire access is completed. data being read from or written to the tpuram may be corrupted by asynchronous reset. refer to 5.7 reset for more information concerning resets. 12.9 tpu microcode emulation the tpuram array can emulate the microcode rom in the tpu module. this pro- vides a means for developing custom tpu code. the tpu selects tpu emulation mode. the tpu is connected to the tpuram via a dedicated bus. while the tpuram array is in tpu emulation mode, the access timing of the tpuram module matches the tim- ing of the tpu microcode rom to ensure accurate emulation. normal accesses through the imb are inhibited and the control registers have no effect, allowing external ram to emulate the tpuram at the same addresses. refer to section 11 time processor unit and to the tpu reference manual (tpurm/ad) for more infor- mation. 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola standby ram with tpu emulation MC68336/376 12-4 user? manual 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-1 section 13 can 2.0b controller module (toucan) this section is an overview of the toucan module. refer to d.10 toucan module for information concerning toucan address map and register structure. 13.1 general the toucan module is a communication controller that implements the controller area network (can) protocol, an asynchronous communications protocol used in au- tomotive and industrial control systems. it is a high speed (1 mbit/sec), short distance, priority based protocol which can communicate using a variety of mediums (for exam- ple, fiber optic cable or an unshielded twisted pair of wires). the toucan supports both the standard and extended identifier (id) message formats specified in the can protocol specification, revision 2.0, part b. the toucan module contains 16 message buffers, which are used for transmit and receive functions. it also contains message filters, which are used to qualify the re- ceived message ids when comparing them to the receive buffer identifiers. figure 13-1 shows a block diagram of the toucan. figure 13-1 toucan block diagram control slave bus cantx0 canrx0 toucan block interface unit 16rx/tx message buffers transmitter receiver cantx1* canrx1* * these pins are not bonded on the mc68376 imb 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-2 user? manual 13.2 external pins the toucan module interface to the can bus is composed of four pins: cantx0 and cantx1, which transmit serial data, and canrx0 and canrx1, which receive serial data. figure 13-2 shows a typical can system. note pins cantx1 and canrx1 are not used on the mc68376. figure 13-2 typical can network each can station is connected physically to the can bus through a transceiver. the transceiver provides the transmit drive, waveshaping, and receive/compare functions required for communicating on the can bus. it can also provide protection against damage to the toucan caused by a defective can bus or a defective can station. 13.3 programmer? model the toucan module address space is split into 128 bytes starting at the base ad- dress, and then an extra 256 bytes starting at the base address +128. the upper 256 are fully used for the message buffer structures. out of the lower 128 bytes, only part is occupied by various registers. refer to d.10 toucan module for detailed informa- tion on the toucan address map and register structure. transceiver can system cantx0 canrx0 can controller (toucan) can system can station 2 can station n can station 1 cantx1* canrx1* * these pins are not bonded on the mc68376 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-3 note the toucan has no hard-wired protection against invalid bit/field programming within its registers. specifically, no protection is provid- ed if the programming does not meet can protocol requirements. programming the toucan control registers is typically done during system initializa- tion, prior to the toucan becoming synchronized with the can bus. the configuration registers can be changed after synchronization by halting the toucan module. this is done when the user sets the halt bit in the toucan module configuration register (canmcr). the toucan responds by asserting the canmcr notrdy bit. addition- ally, the control registers can be modified while the mcu is in background debug mode. 13.4 toucan architecture the toucan module utilizes a flexible design which allows each of its 16 message buffers to be assigned either as a transmit (tx) buffer or a receive (rx) buffer. in ad- dition, to reduce the cpu32 overhead required for message handling each message buffer is assigned an interrupt flag bit to indicate successful completion of transmission or reception, respectively. 13.4.1 tx/rx message buffer structure figure 13-3 displays the extended (29 bit) id message buffer structure. figure 13-4 displays the standard (11 bit) id message buffer structure. figure 13-3 extended id message buffer structure 15 8 7 4 3 0 $0 time stamp code length control/status $2 id[28:18] srr ide id[17:15] id_high $4 id[14:0] rtr id_low $6 data byte 0 data byte 1 $8 data byte 2 data byte 3 $a data byte 4 data byte 5 $c data byte 6 data byte 7 $e reserved 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-4 user? manual figure 13-4 standard id message buffer structure 13.4.1.1 common fields for extended and standard format frames table 13-1 describes the message buffer fields that are common to both extended and standard identifier format frames. notes: 1. for tx message buffers, upon read, the busy bit should be ignored. 15 8 7 4 3 0 $0 time stamp code length control/status $2 id[28:18] rtr 0 0 0 0 id_high $4 16-bit time stamp id_low $6 data byte 0 data byte 1 $8 data byte 2 data byte 3 $a data byte 4 data byte 5 $c data byte 6 data byte 7 $e reserved table 13-1 common extended/standard format frames field description time stamp contains a copy of the high byte of the free running timer, which is captured at the beginning of the identifier field of the frame on the can bus. code refer to tables 13-2 and 13-3 rx length length (in bytes) of the rx data stored in offset $6 through $d of the buffer. this field is written by the toucan module, copied from the dlc (data length code) field of the received frame. tx length length (in bytes) of the data to be transmitted, located in offset $6 through $d of the buffer. this field is written by the cpu32, and is used as the dlc field value. if rtr (remote transmission re- quest) = 1, the frame is a remote frame and will be transmitted without data field, regardless of the value in tx length. data this field can store up to eight data bytes for a frame. for rx frames, the data is stored as it is re- ceived from the bus. for tx frames, the cpu32 provides the data to be transmitted within the frame. reserved this word entry field (16 bits) should not be accessed by the cpu32. table 13-2 message buffer codes for receive buffers rx code before rx new frame description rx code after rx new frame comment 0000 not active ?message buffer is not active. 0100 empty ?message buffer is active and empty. 0010 0010 full ?message buffer is full. 0110 if a cpu32 read occurs be- fore the new frame, new re- ceive code is 0010. 0110 overrun ?second frame was received into a full buffer before the cpu read the first one. 0xy1 1 busy ?message buffer is now being filled with a new receive frame. this condition will be cleared within 20 cycles. 0010 an empty buffer was filled (xy was 10). 0110 a full/overrun buffer was filled (y was 1). 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-5 13.4.1.2 fields for extended format frames table 13-4 describes the message buffer fields used only for extended identifier for- mat frames. 13.4.1.3 fields for standard format frames table 13-5 describes the message buffer fields used only for standard identifier format frames. notes: 1. when a matching remote request frame is detected, the code for such a message buffer is changed to be 1110. table 13-3 message buffer codes for transmit buffers rtr initial tx code description code after successful transmission x 1000 message buffer not ready for transmit. 0 1100 data frame to be transmitted once, unconditionally. 1000 1 1100 remote frame to be transmitted once, and message buffer be- comes an rx message buffer for data frames. 0100 0 1010 1 data frame to be transmitted only as a response to a remote frame, always. 1010 0 1110 data frame to be transmitted only once, unconditionally, and then only as a response to remote frame, always. 1010 table 13-4 extended format frames field description id[28:18]/[17:15] contains the 14 most significant bits of the extended identifier, located in the id high word of the message buffer. substitute remote request (srr) contains a fixed recessive bit, used only in extended format. should be set to one by the user for tx buffers. it will be stored as received on the can bus for rx buffers. id extended (ide) if extended format frame is used, this field should be set to one. if zero, standard format frame should be used. id[14:0] bits [14:0] of the extended identifier, located in the id low word of the message buffer. remote transmission request (rtr) this bit is located in the least significant bit of the id low word of the message buffer; 0 = data frame, 1 = remote frame. 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-6 user? manual 13.4.1.4 serial message buffers to allow double buffering of messages, the toucan has two shadow buffers called serial message buffers. these two buffers are used by the toucan for buffering both received messages and messages to be transmitted. only one serial message buffer is active at a time, and its function depends upon the operation of the toucan at that time. at no time does the user have access to or visibility of these two buffers. 13.4.1.5 message buffer activation/deactivation mechanism each message buffer must be activated once it is configured for the desired operation by the user. a buffer is activated by writing the appropriate code to the control/status word for that buffer. once the buffer is activated, it will begin participating in the normal transmit and receive processes. likewise, a buffer is deactivated by writing the appropriate deactivation code to the control/status word for that buffer. deactivation of a buffer is typically done when the user desires to reconfigure the buffer, for example to change the buffer? function (rx to tx or tx to rx). deactivation should also be done before changing a receive buff- er? message identifier or before loading a new message to be transmitted into a trans- mit buffer. for more details on activation and deactivation of message buffers, and the effects on message buffer operation, refer to 13.5 toucan operation . 13.4.1.6 message buffer lock/release/busy mechanism in addition to the activation/deactivation mechanism, the toucan also utilizes a lock/ release/busy mechanism to assure data coherency during the receive process. the mechanism includes a lock status for each message buffer, and utilizes the two serial message buffers to facilitate frame transfers within the toucan. reading the control/status word of a receive message buffer triggers the lock for that buffer. while locked, a received message cannot be transferred into that buffer from one of the smbs. table 13-5 standard format frames field description 16-bit time stamp the id low word, which is not needed for standard format, is used in a standard format buffer to store the 16-bit value of the free-running timer which is captured at the beginning of the iden- tifier field of the frame on the can bus. id[28:18] contains bits [28:18] of the identifier, located in the id high word of the message buffer. the four least significant bits in this register (corresponding to the ide bit and id[17:15] for an extended identifier message) must all be written as logic zeros to ensure proper operation of the toucan. rtr this bit is located in the id high word of the message buffer; 0 = data frame, 1 = remote frame. rtr/srr bit treatment if the toucan transmits this bit as a one and receives it as a zero, an ?rbitration loss?is indicat- ed. if the toucan transmits this bit as a zero and is receives it as a one, a bit error is indicated. if the toucan transmits a value and receives a matching response, a successful bit transmission is indicated. 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-7 if a message transfer between the message buffer and a serial message buffer is in progress when the control/status word is read, the busy status will be indicated in the code field, and the lock will not be activated. the user can release the lock on a message buffer in one of two ways. reading the control/status word of another message buffer will lock that buffer, releasing the pre- viously locked buffer. a global release can also be performed on any locked message buffer by reading the free-running timer. once a lock is released, any message transfers between an smb and a message buff- er which was delayed due to that buffer being locked will take place. for more details on the message buffer locking mechanism, and the effects on message buffer opera- tion, refer to 13.5 toucan operation . 13.4.2 receive mask registers the receive mask registers are used as acceptance masks for received frame ids. the following masks are defined: ?a global mask, used for receive buffers 0-13 ?two separate masks for buffers 14 and 15 the value of the mask registers should not be changed during normal operation. if the mask register data is changed after the masked identifier of a received message is matched to a locked message buffer, that message will be transferred into that mes- sage buffer once it is unlocked, regardless of whether that message? masked identi- fier still matches the receive buffer identifier. table 13-6 shows mask bit values. table 13-7 shows mask examples for normal and extended messages. refer to ap- pendix d register summary for more information on rx mask registers. table 13-6 receive mask register bit values mask bit values 0 the corresponding incoming id bit is ?on? care? 1 the corresponding id bit is checked against the incoming id bit to see if a match exists. 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-8 user? manual 13.4.3 bit timing the toucan module uses three 8-bit registers to set-up the bit timing parameters re- quired by the can protocol. control registers 1 and 2 (canctrl1, canctrl2) con- tain the propseg, pseg1, pseg2, and the rjw fields which allow the user to configure the bit timing parameters. the prescaler divide register (presdiv) allows the user to select the ratio used to derive the s-clock from the system clock. the time quanta clock operates at the s-clock frequency. table 13-8 provides examples of sys- tem clock, can bit rate, and s-clock bit timing parameters. refer to appendix d register summary for more information on the bit timing registers. notes: 1. match for extended format (mb3). 2. match for standard format (mb2). 3. no match for mb3 because of id0. 4. no match for mb2 because of id28. 5. no match for mb3 because of id28, match for mb14. 6. no match for mb14 because of id27. 7. match for mb14. table 13-7 mask examples for normal/extended messages message buffer (mb) /mask base id id[28:18] ide extended id id[17:0] match mb2 1 1 1 1 1 1 1 1 0 0 0 0 mb3 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 mb4 0 0 0 0 0 0 1 1 1 1 1 0 mb5 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 mb14 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 rx global mask 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 rx message in 1 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 3 1 1 1 1 1 1 1 1 1 0 0 1 0 2 2 1 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 3 0 1 1 1 1 1 1 1 0 0 0 0 4 0 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 5 rx 14 mask 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 rx message in 1 0 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 6 0 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 14 7 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-9 13.4.3.1 configuring the toucan bit timing the following considerations must be observed when programming bit timing func- tions. ?if the programmed presdiv value results in a single system clock per one time quantum, then the pseg2 field in canctrl2 register should not be pro- grammed to zero. ?if the programmed presdiv value results in a single system clock per one time quantum, then the information processing time (ipt) equals three time quanta, otherwise it equals two time quanta. if pseg2 equals two, then the toucan transmits one time quantum late relative to the scheduled sync segment. ?if the prescaler and bit timing control fields are programmed to values that result in fewer than ten system clock periods per can bit time and the can bus loading is 100%, anytime the rising edge of a start-of-frame (sof) symbol transmitted by another node occurs during the third bit of the intermission between messages, the toucan may not be able to prepare a message buffer for transmission in time to begin its own transmission and arbitrate against the message which transmit- ted the early sof. ?the toucan bit time must be programmed to be greater than or equal to nine system clocks, or correct operation is not guaranteed. 13.4.4 error counters the toucan has two error counters, the transmit (tx) error counter and the receive (rx) error counter. refer to appendix d register summary for more informa- tion on error counters. the rules for increasing and decreasing these counters are de- scribed in the can protocol, and are fully implemented in the toucan. each counter has the following features: ?8-bit up/down counter ?increment by 8 (rx error counter also increments by one) ?decrement by one ?avoid decrement when equal to zero ?rx error counter reset to a value between 119 and 127 inclusive, when the toucan transitions from error passive to error active ?following reset, both counters reset to zero ?detect values for error passive, bus off and error active transitions table 13-8 example system clock, can bit rate and s-clock frequencies system clock frequency (mhz) can bit-rate (mhz) possible s-clock frequency (mhz) possible number of time quanta/bit presdiv value + 1 25 1 25 25 1 20 1 10, 20 10, 20 2, 1 16 1 8, 16 8, 16 2, 1 25 0.125 1, 1.25, 2.5 8,10, 20 25, 20,10 20 0.125 1, 2, 2.5 8, 16, 20 20, 10, 8 16 0.125 1, 2 8,16 16, 8 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-10 user? manual ?cascade usage of tx error counter with an additional internal counter to detect the 128 occurrences of 11 consecutive recessive bits necessary to transition from bus off into error active. both counters are read only (except in test/freeze/halt modes). the toucan responds to any bus state as described in the can protocol, transmitting an error active or error passive flag, delaying its transmission start time (error passive) and avoiding any influence on the bus when in the bus off state. the following are the basic rules for toucan bus state transitions: ?if the value of the tx error counter or rx error counter increments to a value greater than or equal to 128, the fault confinement state (fcs[1:0]) field in the error status register is updated to reflect an error passive state. ?if the toucan is in an error passive state, and either the tx error counter or rx error counter decrements to a value less than or equal to 127, while the other er- ror counter already satisfies this condition, the fcs[1:0] field in the error status register is updated to reflect an error active state. ?if the value of the tx error counter increases to a value greater than 255, the fcs[1:0] field in the error status register is updated to reflect a bus off state, and an interrupt may be issued. the value of the tx error counter is reset to zero. ?if the toucan is in the bus off state, the tx error counter and an additional inter- nal counter are cascaded to count 128 occurrences of 11 consecutive recessive bits on the bus. to do this, the tx error counter is first reset to zero, then the in- ternal counter begins counting consecutive recessive bits. each time the internal counter counts 11 consecutive recessive bits, the tx error counter is incremented by one and the internal counter is reset to zero. when the tx error counter reach- es the value of 128, the fcs[1:0] field in the error status register is updated to be error active, and both error counters are reset to zero. any time a dominant bit is detected following a stream of less than 11 consecutive recessive bits, the inter- nal counter resets itself to zero, but does not affect the tx error counter value. ?if only one node is operating in a system, the tx error counter will increment with each message it attempts to transmit, due to the resulting acknowledgment er- rors. however, acknowledgment errors will never cause the toucan to transition from the error passive state to the bus off state. ?if the rx error counter increments to a value greater than 127, it will stop incre- menting, even if more errors are detected while being a receiver. after the next successful message reception, the counter is reset to a value between 119 and 127, to enable a return to the error active state. 13.4.5 time stamp the value of the free-running 16-bit timer is sampled at the beginning of the identifier field on the can bus. for a message being received, the time stamp will be stored in the time stamp entry of the receive message buffer at the time the message is written into that buffer. for a message being transmitted, the time stamp entry will be written into the transmit message buffer once the transmission has completed successfully. 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-11 the free-running timer can optionally be reset upon the reception of a frame into mes- sage buffer 0. this feature allows network time synchronization to be performed. 13.5 toucan operation the basic operation of the toucan can be divided into three areas: ?reset and initialization of the module ?transmit message handling ?receive message handling example sequences for performing each of these processes is given in the following paragraphs. 13.5.1 toucan reset the toucan can be reset in two ways: ?hard reset, using one of the imb reset lines. ?soft reset, using the softrst bit in the module configuration register. following the negation of reset, the toucan is not synchronized with the can bus, and the halt, frz, and frzack bits in the module configuration register are set. in this state, the toucan does not initiate frame transmissions or receive any frames from the can bus. the contents of the message buffers are not changed following re- set. any configuration change/initialization requires that the toucan be frozen by either asserting the halt bit in the module configuration register or by reset. 13.5.2 toucan initialization initialization of the toucan includes the initial configuration of the message buffers and configuration of the can communication parameters following a reset, as well as any reconfiguration which may be required during operation. the following is a generic initialization sequence for the toucan: a. initialize all operation modes 1. initialize the transmit and receive pin modes in control register 0 (canctrl0). 2. initialize the bit timing parameters propseg, psegs1, pseg2, and rjw in control registers 1 and 2 (canctrl[1:2]). 3. select the s-clock rate by programming the presdiv register. 4. select the internal arbitration mode (lbuf bit in canctrl1). b. initialize message buffers 1. the control/status word of all message buffers must be written either as an active or inactive message buffer. 2. all other entries in each message buffer should be initialized as required. c. initialize mask registers for acceptance mask as needed d. initialize toucan interrupt handler 1. initialize the interrupt configuration register (canicr) with a specific request level and vector base address. 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-12 user? manual 2. initialize iarb[3:0] to a non-zero value in canmcr. 3. set the required mask bits in the imask register (for all message buffer interrupts), in canctrl0 (for bus off and error interrupts), and in canmcr for the wake interrupt. e. negate the halt bit in the module configuration register 1. at this point, the toucan will attempt to synchronize with the can bus. note in both the transmit and receive processes, the first action in prepar- ing a message buffer should be to deactivate the buffer by setting its code field to the proper value. this requirement is mandatory to as- sure data coherency. 13.5.3 transmit process the transmit process includes preparing a message buffer for transmission, as well as the internal steps performed by the toucan to decide which message to transmit. for the user, this involves loading the message and id to be transmitted into a message buffer and then activating that buffer as an active transmit buffer. once this is done, the toucan will perform all additional steps necessary to transmit the message onto the can bus. the user should prepare/change a message buffer for transmission by executing the following steps. 1. write the control/status word to hold the transmit buffer inactive (code = %1000) 2. write the id_high and id_low words 3. write the data bytes 4. write the control/status word (active tx code, tx length) note steps 1 and 4 are mandatory to ensure data coherency while prepar- ing a message buffer for transmission. once an active transmit code is written to a transmit message buffer, that buffer will begin participating in an internal arbitration process as soon as the can bus is sensed to be free by the receiver, or at the inter-frame space. if there are multiple messages awaiting transmission, this internal arbitration process selects the message buffer from which the next frame is transmitted. when this process is over, and a message buffer is selected for transmission, the frame from that message buffer is transferred to the serial message buffer for trans- mission. while transmitting, the toucan will transmit no more than eight data bytes, even if the transmit length contains a value greater than eight. 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-13 at the end of a successful transmission, the value of the free-running timer (which was captured at the beginning of the identifier field on the can bus), is written into the time stamp field in the message buffer. the code field in the control/status word of the mes- sage buffer is updated and a status flag is set in the iflag register. 13.5.3.1 transmit message buffer deactivation any write access to the control/status word of a transmit message buffer during the process of selecting a message buffer for transmission immediately deactivates that message buffer, removing it from the transmission process. while a message is being transferred from a transmit message buffer to a serial mes- sage buffer, if the user deactivates that transmit message buffer, the message will not be transmitted. if the user deactivates the transmit message buffer after the message is transferred to the serial message buffer, the message will be transmitted, but no interrupt will be requested and the transmit code will not be updated. if a message buffer containing the lowest id is deactivated while that message is un- dergoing the internal arbitration process to determine which message should be sent, then that message may not be transmitted. 13.5.3.2 reception of transmitted frames the toucan will receive a frame it has transmitted if an empty message buffer with a matching identifier exists. 13.5.4 receive process the receive process includes configuring message buffers for reception, the transfer of received messages by the toucan from the serial message buffers to the receive message buffers with matching ids, and the retrieval of these messages by the user. the user should prepare/change a message buffer for frame reception by executing the following steps. 1. write the control/status word to hold the receive buffer inactive (code = %0000). 2. write the id_high and id_low words. 3. write the control/status word to mark the receive message buffer as active and empty. note steps 1 and 3 are mandatory for data coherency while preparing a message buffer for reception. once these steps are performed, the message buffer functions as an active receive buffer and participates in the internal matching process, which takes place every time the toucan receives an error-free frame. in this process, all active receive buffers compare their id value to the newly received one. if a match is detected, the following actions occur: 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-14 user? manual 1. the frame is transferred to the first (lowest entry) matching receive message buffer. 2. the value of the free-running timer (captured at the beginning of the identifier field on the can bus) is written into the time stamp field in the message buffer. 3. the id field, data field and rx length field are stored. 4. the code field is updated. 5. the status flag is set in the iflag register. the user should read a received frame from its message buffer in the following order: 1. control/status word (mandatory, as it activates the internal lock for this buffer) 2. id (optional, since it is needed only if a mask was used) 3. data field word(s) 4. free-running timer (optional, as it releases the internal lock) if a read of the free running timer is not performed, that message buffer remains locked until the read process starts for another message buffer. only a single message buffer is locked at a time. when reading a received message, the only mandatory read op- eration is that of the control/status word. this assures data coherency. if the busy bit is set in the message buffer code, the cpu32 should defer accessing that buffer until this bit is negated. refer to table 13-2 . note the cpu32 should check the status of a message buffer by reading the status flag in the iflag register and not by reading the control/ status word code field for that message buffer. this prevents the buffer from being locked inadvertently. because the received identifier field is always stored in the matching receive message buffer, the contents of the identifier field in a receive message buffer may change if one or more of the id bits are masked. 13.5.4.1 receive message buffer deactivation any write access to the control/status word of a receive message buffer during the pro- cess of selecting a message buffer for reception immediately deactivates that mes- sage buffer, removing it from the reception process. if a receive message buffer is deactivated while a message is being transferred into it, the transfer is halted and no interrupt is requested. if this occurs, that receive message buffer may contain mixed data from two different frames. data should never be written into a receive message buffer. if this is done while a mes- sage is being transferred from a serial message buffer, the control/status word will re- flect a full or overrun condition, but no interrupt will be requested. 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-15 13.5.4.2 locking and releasing message buffers the lock/release/busy mechanism is designed to guarantee data coherency during the receive process. the following examples demonstrate how the lock/release/busy mechanism will affect toucan operation. 1. reading a control/status word of a message buffer triggers a lock for that message buffer. a new received message frame which matches the message buffer cannot be written into this message buffer while it is locked. 2. to release a locked message buffer, the cpu32 either locks another message buffer by reading its control/status word, or globally releases any locked message buffer by reading the free-running timer. 3. if a receive frame with a matching id is received during the time the message buffer is locked, the receive frame will not be immediately transferred into that message buffer, but will remain in the serial message buffer. there is no indi- cation when this occurs. 4. when a locked message buffer is released, if a frame with a matching identifier exists within the serial message buffer, then this frame will be transferred to the matching message buffer. 5. if two or more receive frames with matching ids are received while a message buffer with a matching id is locked, the last received frame with that id is kept within the serial message buffer, while all preceding ones are lost. there is no indication when this occurs. 6. if the user reads the control/status word of a receive message buffer while a frame is being transferred from a serial message buffer, the busy code will be indicated. the user should wait until this code is cleared before continuing to read from the message buffer to ensure data coherency. in this situation, the read of the control/status word will not lock the message buffer. polling the control/status word of a receive message buffer can lock it, preventing a message from being transferred into that buffer. if the control/status word of a receive message buffer is read, it should then be followed by a read of the control/status word of another buffer, or by reading the free-running timer, to ensure that the locked buffer is unlocked. 13.5.5 remote frames the remote frame is a message frame which is transmitted to request a data frame. the toucan can be configured to transmit a data frame automatically in response to a remote frame, or to transmit a remote frame and then wait for the responding data frame to be received. when transmitting a remote frame, the user initializes a message buffer as a transmit message buffer with the rtr bit set to one. once this remote frame is transmitted suc- cessfully, the transmit message buffer automatically becomes a receive message buff- er, with the same id as the remote frame which was transmitted. when a remote frame is received by the toucan, the remote frame id is compared to the ids of all transmit message buffers programmed with a code of 1010. if there is an exact matching id, the data frame in that message buffer is transmitted. if the rtr 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-16 user? manual bit in the matching transmit message buffer is set, the toucan will transmit a remote frame as a response. a received remote frame is not stored in a receive message buffer. it is only used to trigger the automatic transmission of a frame in response. the mask registers are not used in remote frame id matching. all id bits (except rtr) of the incoming received frame must match for the remote frame to trigger a response transmission. 13.5.6 overload frames overload frame transmissions are not initiated by the toucan unless certain condi- tions are detected on the can bus. these conditions include: ?detection of a dominant bit in the first or second bit of intermission. ?detection of a dominant bit in the seventh (last) bit of the end-of-frame (eof) field in receive frames. ?detection of a dominant bit in the eighth (last) bit of the error frame delimiter or overload frame delimiter. 13.6 special operating modes the toucan module has three special operating modes: ?debug mode ?low-power stop mode ?auto power save mode 13.6.1 debug mode debug mode is entered by setting the halt bit in the canmcr, or by assertion of the imb freeze line. in both cases, the frz1 bit in canmcr must also be set to allow halt or freeze to place the toucan in debug mode. once entry into debug mode is requested, the toucan waits until an intermission or idle condition exists on the can bus, or until the toucan enters the error passive or bus off state. once one of these conditions exists, the toucan waits for the comple- tion of all internal activity. when this happens, the following events occur: ?the toucan stops transmitting/receiving frames. ?the prescaler is disabled, thus halting all can bus communication. ?the toucan ignores its rx pins and drives its tx pins as recessive. ?the toucan loses synchronization with the can bus and the notrdy and frzack bits in canmcr are set. ?the cpu32 is allowed to read and write the error counter registers. after engaging one of the mechanisms to place the toucan in debug mode, the user must wait for the frzack bit to be set before accessing any other registers in the toucan, otherwise unpredictable operation may occur. to exit debug mode, the imb freeze line must be negated or the halt bit in canmcr must be cleared. 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-17 once debug mode is exited, the toucan will resynchronize with the can bus by wait- ing for 11 consecutive recessive bits before beginning to participate in can bus com- munication. 13.6.2 low-power stop mode before entering low-power stop mode, the toucan will wait for the can bus to be in an idle state, or for the third bit of intermission to be recessive. the toucan then waits for the completion of all internal activity (except in the can bus interface) to be com- plete. afterwards, the following events occur: ?the toucan shuts down its clocks, stopping most internal circuits, thus achieving maximum power savings. ?the bus interface unit continues to operate, allowing the cpu32 to access the module configuration register. ?the toucan ignores its rx pins and drives its tx pins as recessive. ?the toucan loses synchronization with the can bus, and the stopack and notrdy bits in the module configuration register are set. to exit low-power stop mode: ?reset the toucan either by asserting one of the imb reset lines or by asserting the softrst bit canmcr. ?clear the stop bit in canmcr. ?the toucan module can optionally exit low-power stop mode via the self-wake mechanism. if the selfwake bit in canmcr was set at the time the toucan entered stop mode, then upon detection of a recessive to dominant transition on the can bus, the toucan clears the stop bit in canmcr and its clocks begin running. when in low-power stop mode, a recessive to dominant transition on the can bus causes the wakeint bit in the error and status register (estat) to be set. this event can generate an interrupt if the wakemsk bit in canmcr is set. consider the following notes regarding low-power stop mode: ?when the self-wake mechanism activates, the toucan tries to receive the frame that woke it up. (it assumes that the dominant bit detected is a start-of-frame bit). it will not arbitrate for the can bus at this time. ?if the stop bit is set while the toucan is in the bus off state, then the toucan will enter low-power stop mode and stop counting recessive bit times. the count will continue when stop is cleared. ?to place the toucan in low-power stop mode with the self-wake mechanism engaged, write to canmcr with both stop and selfwake set, then wait for the toucan to set the stopack bit. ?to take the toucan out of low-power stop mode when the self-wake mechanism is enabled, write to canmcr with both stop and selfwake clear, then wait for the toucan to clear the stopack bit. ?the selfwake bit should not be set after the toucan has already entered low- power stop mode. 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-18 user? manual ?if both stop and selfwake are set and a recessive to dominant edge immediately occurs on the can bus, the toucan may never set the stopack bit, and the stop bit will be cleared. ?to prevent old frames from being sent when the toucan awakes from low-power stop mode via the self-wake mechanism, disable all transmit sources, including transmit buffers configured for remote request responses, before placing the toucan in low-power stop mode. ?if the toucan is in debug mode when the stop bit is set, the toucan will assume that debug mode should be exited. as a result, it will try to synchronize with the can bus, and only then will it await the conditions required for entry into low-power stop mode. ?unlike other modules, the toucan does not come out of reset in low-power stop mode. the basic toucan initialization procedure (see 13.5.2 toucan initializa- tion ) should be executed before placing the module in low-power stop mode. ?if the toucan is in low-power stop mode with the self-wake mechanism engaged and is operating with a single system clock per time quantum, there can be ex- treme cases in which toucan wake-up on recessive to dominant edge may not conform to the can protocol. toucan synchronization will be shifted one time quantum from the wake-up event. this shift lasts until the next recessive to dom- inant edge, which resynchronizes the toucan to be in conformance with the can protocol. the same holds true when the toucan is in auto power save mode and awakens on a recessive to dominant edge. 13.6.3 auto power save mode auto power save mode enables normal operation with optimized power savings. once the auto power save (aps) bit in canmcr is set, the toucan looks for a set of con- ditions in which there is no need for the clocks to be running. if these conditions are met, the toucan stops its clocks, thus saving power. the following conditions will activate auto power save mode. ?no rx/tx frame in progress. ?no transfer of rx/tx frames to and from a serial message buffer, and no tx frame awaiting transmission in any message buffer. ?no cpu32 access to the toucan module. ?the toucan is not in debug mode, low-power stop mode, or the bus off state. while its clocks are stopped, if the toucan senses that any one of the aforementioned conditions is no longer true, it restarts its clocks. the toucan then continues to mon- itor these conditions and stops/restarts its clocks accordingly. 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 can 2.0b controller module (toucan) motorola user? manual 13-19 13.7 interrupts the toucan is capable of generating one interrupt level on the imb. this level is programmed into the priority level bits in the interrupt configuration register (canicr). this value determines which interrupt signal is driven onto the bus when an interrupt is requested. when an interrupt is requested, the cpu32 initiates an iack cycle. the toucan decodes the iack cycle and compares the cpu32 recognized level to the level that it is currently requesting. if a match occurs, then arbitration begins. if the toucan wins arbitration, it generates a uniquely encoded interrupt vector that indicates which event is requesting service. this encoding scheme is as follows: ?the higher-order bits of the interrupt vector come from the ivba[2:0] field in canicr. ?the low-order five bits are an encoded value that indicate which of the 19 toucan interrupt sources is requesting service. figure 13-5 shows a block diagram of the interrupt hardware. figure 13-5 toucan interrupt vector generation each one of the 16 message buffers can be an interrupt source, if its corresponding imask bit is set. there is no distinction between transmit and receive interrupts for a particular buffer. each of the buffers is assigned a bit in the iflag register. an iflag bit is set when the corresponding buffer completes a successful transmission/recep- tion. an iflag bit is cleared when the cpu32 reads iflag while the associated bit is set, and then writes it back as zero (and no new event of the same type occurs be- tween the read and the write actions). toucan interrupt gen interrupt request level masks buffer interrupts bus off error wake up vector base address (ivba[2:0]) interrupt level decoder interrupt priority encoder interrupt enable logic 16 19 3 irq[7:1] 7 3 module interrupt vector 5 19 3 (ilcan[2:0] 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola can 2.0b controller module (toucan) MC68336/376 13-20 user? manual the other three interrupt sources (bus off, error and wake up) act in the same way, and have flag bits located in the error and status register (estat). the bus off and error interrupt mask bits (boffmsk and errmsk) are located in canctrl0, and the wake up interrupt mask bit (wakemsk) is located in the module configuration register. refer to appendix d register summary for more information on these registers. table 13-9 shows toucan interrupt priorities and their corresponding vector addresses. table 13-9 interrupt sources and vector addresses interrupt source vector number buffer 0 %xxx00000 (highest priority) buffer 1 %xxx00001 buffer 2 %xxx00010 buffer 3 %xxx00011 buffer 4 %xxx00100 buffer 5 %xxx00101 buffer 6 %xxx00110 buffer 7 %xxx00111 buffer 8 %xxx01000 buffer 9 %xxx01001 buffer 10 %xxx01010 buffer 11 %xxx01011 buffer 12 %xxx01100 buffer 13 %xxx01101 buffer 14 %xxx01110 buffer 15 %xxx01111 bus off %xxx10000 error %xxx10001 wake-up %xxx10010 (lowest priority) 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-1 appendix a electrical characteristics this appendix contains electrical specification tables and reference timing diagrams for MC68336 and mc68376 microcontroller units. notes: 1. permanent damage can occur if maximum ratings are exceeded. exposure to voltages or currents in excess of recommended values affects device reliability. device modules may not operate normally while being ex- posed to electrical extremes. 2. although sections of the device contain circuitry to protect against damage from high static voltages or elec- trical fields, take normal precautions to avoid exposure to voltages higher than maximum-rated voltages. 3. all pins except tstme /tsc. 4. all functional non-supply pins are internally clamped to v ss . all functional pins except extal and xfc are internally clamped to v dd . does not include qadc pins (refer to table a-11 ). 5. input must be current limited to the value specified. to determine the value of the required current-limiting resistor, calculate resistance values for positive and negative clamp voltages, then use the larger of the two values. 6. power supply must maintain regulation within operating v dd range during instantaneous and operating max- imum current conditions. 7. this parameter is periodically sampled rather than 100% tested. 8. total input current for all digital input-only and all digital input/output pins must not exceed 10 ma. exceeding this limit can cause disruption of normal operation. table a-1 maximum ratings num rating symbol value unit 1 supply voltage 1, 2, v dd ?0.3 to + 6.5 v 2 input voltage 1, 2, 3, 5, 7 v in ?0.3 to + 6.5 v 3 instantaneous maximum current single pin limit (applies to all pins) 1, 5, 6, 7 i d 25 ma 4 operating maximum current digital input disruptive current 4, 5, 6, 7, 8 v negclmap @ ?0.3 v v posclamp @ v dd + 0.3 i id ?500 to 500 m a 5 operating temperature range MC68336/376 ??suffix MC68336/376 ??suffix MC68336/376 ??suffix t a t l to t h ?40 to 85 ?40 to 105 ?40 to 125 c 6 storage temperature range t stg ?55 to 150 c 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-2 user? manual table a-2 typical ratings num rating symbol value unit 1 supply voltage v dd 5.0 v 2 operating temperature t a 25 c 3 v dd supply current run lpstop, vco off lpstop, external clock, maxi f sys i dd 113 125 3.75 ma m a ma 4 clock synthesizer operating voltage v ddsyn 5.0 v 5 v ddsyn supply current vco on, maximum f sys external clock, maximum f sys lpstop, vco off v dd powered down i ddsyn 1.0 5.0 100 50 ma ma m a m a 6 ram standby voltage v sb 3.0 v 7 ram standby current normal ram operation standby operation i sb 7.0 40 m a m a 8 power dissipation p d 570 mw table a-3 thermal characteristics num rating symbol value unit 1 thermal resistance plastic 160-pin surface mount q ja 37 c/w the average chip-junction temperature (tj) in c can be obtained from: (1) where: t a = ambient temperature, c q ja = package thermal resistance, junction-to-ambient, c/w p d = p int + p i/o p int = i dd v dd , watts ?chip internal power p i/o = power dissipation on input and output pins ?user determined for most applications p i/o < p int and can be neglected. an approximate relationship between p d and t j (if p i/o is neglected) is: (2) solving equations 1 and 2 for k gives: (3) where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a . t j t a p d q ja () + = p d kt j 273 c + () ? = kp d t a 273 c + ()q ja p d 2 ++ = 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-3 notes: 1. all internal registers retain data at 0 hz. 2. this parameter is periodically sampled rather than 100% tested. 3. assumes that a low-leakage external filter network is used to condition clock synthesizer input voltage. total external resistance from the xfc pin due to external leakage must be greater than 15 m w to guarantee this specification. filter network geometry can vary depending upon operating environment . 4. proper layout procedures must be followed to achieve specifications. 5. assumes that stable v ddsyn is applied, and that the crystal oscillator is stable. lock time is measured from the time v dd and v ddsyn are valid until reset is released. this specification also applies to the period required for pll lock after changing the w and y frequency control bits in the synthesizer control register (syncr) while the pll is running, and to the period required for the clock to lock after lpstop. 6. internal vco frequency (f vco ) is determined by syncr w and y bit values. the syncr x bit controls a di- vide-by-two circuit that is not in the synthesizer feedback loop. when x = 0, the divider is enabled, and f sys = f vco ? 4. when x = 1, the divider is disabled, and f sys = f vco ? 2. x must equal one when operating at maximum specified f sys . 7. jitter is the average deviation from the programmed frequency measured over the specified interval at maxi- mum f sys . measurements are made with the device powered by filtered supplies and clocked by a stable exter- nal clock signal. noise injected into the pll circuitry via v ddsyn and v ss and variation in crystal oscillator frequency increase the j clk percentage for a given interval. when jitter is a critical constraint on control system operation, this parameter should be measured during functional testing of the final system. table a-4 clock control timing (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h, 4.194 mhz reference) num characteristic symbol min max unit 1 pll reference frequency range f ref 4.194 5.243 mhz 2 system frequency 1 on-chip pll system frequency external clock operation f sys dc f ref /32 dc 20.97 20.97 20.97 mhz 3 pll lock time 2, 3, 4, 5 t lpll ?0ms 4 vco frequency 6 f vco 2 (f sys max) mhz 5 limp mode clock frequency syncr x bit = 0 syncr x bit = 1 f limp f sys max/2 f sys max mhz 6 clkout jitter 2, 3, 4, 7 short term (5 m s interval) long term (500 m s interval) j clk ?.625 ?.0625 ?.625 ?.0625 % 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-4 user? manual table a-5 dc characteristics (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) num characteristic symbol min max unit 1 input high voltage v ih 0.7 ( v dd )v dd + 0.3 v 2 input low voltage v il v ss ?0.3 0.2 ( v dd )v 3 input hysteresis 1 v hys 0.5 v 4 input leakage current 2 v in = v dd or v ss input-only pins i in ?.5 2.5 m a 5 high impedance (off-state) leakage current 2 v in = v dd or v ss all input/output and output pins i oz ?.5 2.5 m a 6 cmos output high voltage 2 , 3 i oh = ?0.0 m a group 1, 2, 4 input/output and all output pins v oh v dd ?0.2 v 7 cmos output low voltage 2 i ol = 10.0 m a group 1, 2, 4 input/output and all output pins v ol 0.2 v 8 output high voltage 2 , 3 i oh = ?.8 ma group 1, 2, 4 input/output and all output pins v oh v dd ?0.8 v 9 output low voltage 2 i ol = 1.6 ma group 1 i/o pins, clkout, freeze/quot, ipipe i ol = 5.3 ma group 2 and group 4 i/o pins, csboot , bg /cs i ol = 12 ma group 3 v ol 0.4 0.4 0.4 v 10 three state control input high voltage v ihtsc 1.6 (v dd ) 9.1 v 11 data bus mode select pull-up current 4 v in = v il data[15:0] v in = v ih data[15:0] i msp ?5 ?20 m a 12a MC68336 v dd supply current 5 run 6 run, tpu emulation mode lpstop, 4.194 mhz crystal, vco off (stsim = 0) lpstop (external clock input frequency = maximum f sys ) i dd i dd s idd s idd 140 150 3 7 ma ma ma ma 12b mc68376 v dd supply current 5 run 6 run, tpu emulation mode lpstop, 4.194 mhz crystal, vco off (stsim = 0) lpstop (external clock input frequency = maximum f sys ) i dd i dd s idd s idd 150 160 3 7 ma ma ma ma 13 clock synthesizer operating voltage v ddsyn 4.75 5.25 v 14 v ddsyn supply current 5 4.194 mhz crystal, vco on, maximum f sys external clock, maximum f sys lpstop, 4.194 mhz crystal, vco off (stsim = 0) 4.194 mhz crystal, v dd powered down i ddsyn i ddsyn s iddsyn i ddsyn 3 5 3 3 ma ma ma ma 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-5 15 ram standby voltage 7 specified v dd applied v dd = v ss v sb 0.0 3.0 5.25 5.25 v 16 ram standby current 5 , 7 , 8 normal ram operationv dd > v sb ?0.5 v transient condition v sb ?0.5 v 3 v dd 3 v ss + 0.5 v standby operation v dd < v ss + 0.5 v i sb 10 3 100 m a ma m a 17a MC68336 power dissipation 9 p d 756 mw 17b mc68376 power dissipation 9 p d 809 mw 18 input capacitance 2 , 10 all input-only pins all input/output pins c in 10 20 pf 19 load capacitance 2 group 1 i/o pins and clkout, freeze/quot, ipipe group 2 i/o pins and csboot , bg /cs group 3 i/o pins group 4 i/o pins c l 90 100 130 200 pf table a-5 dc characteristics (continued) (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) num characteristic symbol min max unit 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-6 user? manual notes: 1. applies to : port e[7:4] ?siz[1:0], as , ds port f[7:0] ?irq[7:1] , modclk port qs[7:0] ?txd, pcs[3:1], pcs0/ss , sck, mosi, miso tpuch[15:0], t2clk, cpwm[8:5], ctd[4:3], ctd[10:9], ctm2c bkpt /dsclk, ifetch , reset , rxd, tstme /tsc extal (when pll enabled) 2. input-only pins: extal, tstme /tsc, bkpt , pai, t2clk, rxd, ctm2c output-only pins: csboot , bg /cs , clkout, freeze/quot, ipipe input/output pins: group 1: data[15:0], ifetch , tpuch[15:0], cpwm[8:5], ctd[4:3], ctd[10:9] group 2: port c[6:0] ?addr[22:19]/cs[9:6] , fc[2:0]/cs[5:3 ] port e[7:0] ?siz[1:0], as , ds , avec , rmc , dsack[1:0] port f[7:0] ?irq[7:1] , modclk port qs[7:3] ?txd, pcs[3:1], pcs0/ss addr23/cs10 /eclk, addr[18:0], r/w , berr , br /cs0 , bgack /cs2 group 3: halt , reset group 4: miso, mosi, sck pin groups do not include qadc pins. see tables a-11 through a-14 for information concerning the qadc. 3. does not apply to halt and reset because they are open drain pins. does not apply to port qs[7:0] (txd, pcs[3:1], pcs0/ss , sck, mosi, miso) in wired-or mode. 4. use of an active pulldown device is recommended. 5. total operating current is the sum of the appropriate i dd , i ddsyn , and i sb values. i dd values include supply currents for device modules powered by v dde and v ddi pins. 6. current measured at maximum system clock frequency, all modules active. 7. the sram module will not switch into standby mode as long as v sb does not exceed v dd by more than 0.5 volts. the sram array cannot be accessed while the module is in standby mode. 8. when v dd is transitioning during power-up or power down sequence, and v sb is applied, current flows between the v stby and v dd pins, which causes standby current to increase toward the maximum transient condition specification. system noise on the v dd and v stby pins can contribute to this condition. 9. power dissipation measured at system clock frequency, all modules active. power dissipation can be calculated us- ing the following expression: p d = maximum v dd (run i dd + i ddsyn + i sb ) + maximum v dda (i dda ) 10. this parameter is periodically sampled rather than 100% tested. 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-7 table a-6 ac timing (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) 1 num characteristic symbol min max unit f1 frequency of operation 2 f sys 20.97 mhz 1 clock period t cyc 47.7 ns 1a eclk period t ecyc 381 ns 1b external clock input period 3 t xcyc 47.7 ns 2, 3 clock pulse width t cw 18.8 ns 2a, 3a eclk pulse width t ecw 183 ns 2b, 3b external clock input high/low time 3 t xchl 23.8 ns 3, 4 clock rise and fall time t crf ?ns 4a, 5a rise and fall time ?all outputs except clkout t rf ?ns 4b, 5b external clock rise and fall time 4 t xcrf ?ns 4 clock high to address, fc, size, rmc valid t chav 023ns 5 clock high to address, data, fc, size, rmc high impedance t chazx 047ns 6 clock high to address, fc, size, rmc invalid 5 t chazn 0ns 7 clock low to as , ds , cs asserted t clsa 023ns 8a as to ds or cs asserted (read) 6 t stsa ?0 10 ns 8c clock low to ifetch , ipipe asserted t clia 222ns 11 address, fc, size, rmc valid to as , cs asserted t avsa 10 ns 12 clock low to as , ds , cs negated t clsn 223ns 12a clock low to ifetch , ipipe negated t clin 222ns 13 as , ds , cs negated to address, fc, size invalid (address hold) t snai 10 ns 14 as , cs width asserted t swa 80 ns 14a ds , cs width asserted (write) t swaw 36 ns 14b as , cs width asserted (fast write cycle) t swdw 32 ns 15 as , ds , cs width negated 7 t sn 32 ns 16 clock high to as , ds , r/w high impedance t chsz ?7ns 17 as , ds , cs negated to r/w negated t snrn 10 ns 18 clock high to r/w high t chrh 023ns 20 clock high to r/w low t chrl 023ns 21 r/w asserted to as , cs asserted t raaa 10 ns 22 r/w low to ds , cs asserted (write) t rasa 54 ns 23 clock high to data out valid t chdo ?3ns 24 data out valid to negating edge of as , cs t dvasn 10 ns 25 ds , cs negated to data out invalid (data out hold) t sndoi 10 ns 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-8 user? manual 26 data out valid to ds , cs asserted (write) t dvsa 10 ns 27 data in valid to clock low (data setup) 5 t dicl 5ns 27a late berr , halt asserted to clock low (setup time) t belcl 15 ns 28 as , ds negated to dsack[1:0] , berr , halt , avec negated t sndn 060ns 29 ds , cs negated to data in invalid (data in hold) 8 t sndi 0ns 29a ds , cs negated to data in high impedance 8 , 9 t shdi ?8ns 30 clkout low to data in invalid (fast cycle hold) 8 t cldi 10 ns 30a clkout low to data in high impedance 8 t cldh ?2ns 31 dsack[1:0] asserted to data in valid 10 t dadi ?6ns 33 clock low to bg asserted/negated t clban ?3ns 35 br asserted to bg asserted (rmc not asserted) 11 t braga 1t cyc 37 bgack asserted to bg negated t gagn 12t cyc 39 bg width negated t gh 2t cyc 39a bg width asserted t ga 1t cyc 46 r/w width asserted (write or read) t rwa 115 ns 46a r/w width asserted (fast write or read cycle) t rwas 70 ns 47a asynchronous input setup time br , bgack , dsack[1:0] , berr , avec , halt t aist 5ns 47b asynchronous input hold time t aiht 12 ns 48 dsack[1:0] asserted to berr , halt asserted 12 t daba ?0ns 53 data out hold from clock high t doch 0ns 54 clock high to data out high impedance t chdh ?3ns 55 r/w asserted to data bus impedance change t radc 32 ns 56 reset pulse width (reset instruction) t hrpw 512 t cyc 57 berr negated to halt negated (rerun) t bnhn 0ns 70 clock low to data bus driven (show) t scldd 023ns 71 data setup time to clock low (show) t sclds 10 ns 72 data hold from clock low (show) t scldh 10 ns 73 bkpt input setup time t bkst 10 ns 74 bkpt input hold time t bkht 10 ns 75 mode select setup time t mss 20 t cyc table a-6 ac timing (continued) (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) 1 num characteristic symbol min max unit 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-9 notes: 1. all ac timing is shown with respect to 20% v dd and 70% v dd levels unless otherwise noted. 2. the base configuration of the MC68336/376 requires a 20.97 mhz crystal reference. 3. when an external clock is used, minimum high and low times are based on a 50% duty cycle. the minimum allowable t xcyc period is reduced when the duty cycle of the external clock signal varies. the relationship between external clock input duty cycle and minimum t xcyc is expressed: minimum t xcyc period = minimum t xchl / (50% ?xternal clock input duty cycle tolerance). 4. parameters for an external clock signal applied while the internal pll is disabled (modclk pin held low during reset). does not pertain to an external vco reference applied while the pll is enabled (modclk pin held high during reset). when the pll is enabled, the clock synthesizer detects successive transitions of the reference signal. if transitions occur within the correct clock period, rise/fall times and duty cycle are not critical. 5. address access time = (2.5 + ws) t cyc ?t chav ?t dicl chip select access time = (2 + ws) t cyc ?t lsa ?t dicl where: ws = number of wait states. when fast termination is used (2 clock bus) ws = ?. 6. specification 9a is the worst-case skew between as and ds or cs . the amount of skew depends on the relative loading of these signals. when loads are kept within specified limits, skew will not cause as and ds to fall outside the limits shown in specification 9. 7. if multiple chip selects are used, cs width negated (specification 15) applies to the time from the negation of a heavily loaded chip select to the assertion of a lightly loaded chip select. the cs width negated specification between multiple chip selects does not apply to chip selects being used for synchronous eclk cycles. 8. hold times are specified with respect to ds or cs on asynchronous reads and with respect to clkout on fast cycle reads. the user is free to use either hold time. 9. maximum value is equal to (t cyc / 2) + 25 ns. 10. if the asynchronous setup time (specification 47a) requirements are satisfied, the dsack[1:0] low to data setup time (specification 31) and dsack[1:0] low to berr low setup time (specification 48) can be ignored. the data must only satisfy the data-in to clock low setup time (specification 27) for the following clock cycle. berr must satisfy only the late berr low to clock low setup time (specification 27a) for the following clock cycle. 11. to ensure coherency during every operand transfer, bg will not be asserted in response to br until after all cycles of the current operand transfer are complete and rmc is negated. 12. in the absence of dsack[1:0] , berr is an asynchronous input using the asynchronous setup time (specification 47a). 13. after external reset negation is detected, a short transition period (approximately 2 t cyc ) elapses, then the sim drives reset low for 512 t cyc . 14. external assertion of the reset input can overlap internally-generated resets. to insure that an external reset is recognized in all cases, reset must be asserted for at least 590 clkout cycles. 15. external logic must pull reset high during this period in order for normal mcu operation to begin. 76 mode select hold time t msh 0ns 77 reset assertion time 13 t rsta 4t cyc 78 reset rise time 14 , 15 t rstr ?0t cyc table a-6 ac timing (continued) (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) 1 num characteristic symbol min max unit 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-10 user? manual figure a-1 clkout output timing diagram figure a-2 external clock input timing diagram figure a-3 eclk output timing diagram 68300 clkout tim 4 clkout 5 2 3 1 68300 ext clk input tim 4b extal 5b 2b 3b 1b note: timing shown with respect to 20% and 70% v dd . pulse width shown with respect to 50% v dd . 68300 eclk output tim 4a eclk 5a 2a 3a 1a note: timing shown with respect to 20% and 70% v dd. 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-11 figure a-4 read cycle timing diagram 68300 rd cyc tim clkout s0 s1 s2 s3 s4 s5 48 27a 27 28 29 47a 21 9a 11 12 8 6 addr[23:20] fc[2:0] siz[1:0] ds cs r/w as dsack0 dsack1 data[15:0] berr ifetch 20 18 47b 47a asynchronous inputs halt 12a 12a 9c bkpt 9 74 73 17 14 15 13 46 31 29a 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-12 user? manual figure a-5 write cycle timing diagram 68300 wr cyc tim clkout s0 s1 s2 s3 s4 s5 27a 28 25 20 9 11 12 8 6 addr[23:20] fc[2:0] siz[1:0] ds cs r/w as dsack0 dsack1 data[15:0] berr halt bkpt 54 53 55 47a 26 23 9 74 73 21 14 22 14a 17 46 13 15 48 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-13 figure a-6 fast termination read cycle timing diagram 68300 fast rd cyc tim clkout s0 s1 s4 s5 s0 18 9 6 addr[23:0] fc[2:0] siz[1:0] ds cs r/w as data[15:0] 14b 8 bkpt 12 46a 30 27 73 29a 20 74 30a 29 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-14 user? manual figure a-7 fast termination write cycle timing diagram 68300 fast wr cyc tim clkout s0 s1 s4 s5 s0 20 9 6 addr[23:0] fc[2:0] siz[1:0] ds cs r/w as data[15:0] 14b 8 bkpt 12 46a 23 73 24 18 25 74 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-15 figure a-8 bus arbitration timing diagram ?active bus case 68300 bus arb tim clkout s0 s1 s2 s3 s4 addr[23:0] data[15:0] 7 s98 a5 a5 a2 47a 39a 35 33 33 16 s5 as ds r/w dsack0 dsack1 br bg bgack 37 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-16 user? manual figure a-9 bus arbitration timing diagram ?idle bus case 68300 bus arb tim idle clkout a0 a5 addr[23:0] data[15:0] a2 a3 a0 a5 br as bg bgack 47a 33 33 47a 37 47a 35 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-17 figure a-10 show cycle timing diagram clkout s0 s41 s42 s0 s1 s2 6 addr[23:0] r/w as 8 ds 72 data[15:0] bkpt 71 70 12 9 15 73 18 20 show cycle start of external cycle 74 s43 68300 shw cyc tim note: show cycles can stretch during clock phase s42 when bus accesses take longer than two cycles due to imb module wait-state insertion. 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-18 user? manual figure a-11 chip-select timing diagram figure a-12 reset and mode select timing diagram 68300 chip sel tim 6 6 8 11 11 25 53 54 23 55 29a 29 27 46 46 14a 12 13 15 9 9 12 14 9 18 20 18 s0 s1 s2 s3 s4 s5 s0 s1 s2 s3 s4 s5 14 clkout addr[23:0] fc[2:0] siz[1:0] as ds cs r/w data[15:0] 21 21 17 17 68300 rst/mode sel tim reset data[15:0] 75 76 77 78 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-19 notes: 1. all ac timing is shown with respect to 20% v dd and 70% v dd levels unless otherwise noted . table a-7 background debug mode timing (v dd = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) 1 num characteristic symbol min max unit b0 dsi input setup time t dsisu 15 ns b1 dsi input hold time t dsih 10 ns b2 dsclk setup time t dscsu 15 ns b3 dsclk hold time t dsch 10 ns b4 dso delay time t dsod ?5ns b5 dsclk cycle time t dsccyc 2 t cyc b6 clkout low to freeze asserted/negated t frzan ?0ns b7 clkout high to ifetch high impedance t ipz tbd ns b8 clkout high to ifetch valid t ip tbd ns b9 dsclk low time t dsclo 1t cyc 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-20 user? manual figure a-13 background debugging mode timing ?serial communication figure a-14 background debugging mode timing ?freeze assertion 68300 bkgd dbm ser com tim b1 b3 b2 b0 b4 clkout freeze bkpt /dsclk ifetch /dsi ipipe /dso b5 b9 68300 bdm frz tim b8 clkout freeze ifetch /dsi b6 b6 b7 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-21 notes: 1. all ac timing is shown with respect to 20% v dd and 70% v dd levels unless otherwise noted. 2. when the previous bus cycle is not an eclk cycle, the address may be valid before eclk goes low. 3. address access time = t ecyc ?t ead ?t edsr . 4. chip select access time = t ecyc ?t ecsd ?t edsr . table a-8 eclk bus timing (v dd = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) 1 num characteristic symbol min max unit e1 eclk low to address valid 2 t ead ?8 ns e2 eclk low to address hold t eah 10 ns e3 eclk low to cs valid (cs delay) t ecsd 120 ns e4 eclk low to cs hold t ecsh 10 ns e5 cs negated width t ecsn 25 ns e6 read data setup time t edsr 25 ns e7 read data hold time t edhr 5ns e8 eclk low to data high impedance t edhz ?8 ns e9 cs negated to data hold (read) t ecdh 0ns e10 cs negated to data high impedance t ecdz ?t cyc e11 eclk low to data valid (write) t eddw ?t cyc e12 eclk low to data hold (write) t edhw 10 ns e13 address access time (read) 3 t eacc 308 ns e14 chip select access time (read) 4 t eacs 236 ns e15 address setup time t eas 1/2 t cyc 336376umbook page 21 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-22 user? manual figure a-15 eclk timing diagram 68300 e cycle tim clkout addr[23:0] cs eclk data[15:0] e1 2a 3a e2 e5 e4 e3 e9 e7 e8 e10 e12 e14 e13 1a data[15:0] e15 e11 write read write e6 r/w 336376umbook page 22 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-23 notes: 1. all ac timing is shown with respect to 20% v dd and 70% v dd levels unless otherwise noted. 2. for high time, n = external sck rise time; for low time, n = external sck fall time. table a-9 qspi timing (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h 200 pf load on all qspi pins) 1 num function symbol min max unit 1 operating frequency master slave f qspi dc dc 1/4 1/4 f sys f sys 2 cycle time master slave t qcyc 4 4 510 t cyc t cyc 3 enable lead time master slave t lead 2 2 128 t cyc t cyc 4 enable lag time master slave t lag 2 1/2 sck t cyc 5 clock (sck) high or low time master slave 2 t sw 2 t cyc ?60 2 t cyc ?n 255 t cyc ns ns 6 sequential transfer delay master slave (does not require deselect) t td 17 13 8192 t cyc t cyc 7 data setup time (inputs) master slave t su 30 20 ns ns 8 data hold time (inputs) master slave t hi 0 20 ns ns 9 slave access time t a ? t cyc 10 slave miso disable time t dis ? t cyc 11 data valid (after sck edge) master slave t v 50 50 ns ns 12 data hold time (outputs) master slave t ho 0 0 ns ns 13 rise time input output t ri t ro 2 30 m s ns 14 fall time input output t fi t fo 2 30 m s ns 336376umbook page 23 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-24 user? manual figure a-16 qspi timing ?master, cpha = 0 figure a-17 qspi timing ?master, cpha = 1 qspi mast cpha0 13 11 6 10 12 4 4 13 12 3 2 5 1 data lsb in msb in msb out msb in msb out data lsb out port data 7 12 13 pcs[3:0] output pd miso input mosi output sck cpol=0 output sck cpol=1 output qspi mast cpha1 13 11 10 12 4 4 13 12 3 2 5 1 msb pcs[3:0] output miso input msb msb out data lsb out port data 12 13 port data mosi output data lsb in msb in 7 6 1 sck cpol=0 output sck cpol=1 output 336376umbook page 24 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-25 figure a-18 qspi timing ?slave, cpha = 0 figure a-19 qspi timing ?slave, cpha = 1 13 10 13 7 6 8 11 9 11 12 4 13 12 3 2 5 1 data lsb out pd msb out msb in msb out msb in data lsb in ss input sck cpol=0 input sck cpol=1 input miso output mosi input 4 qspi slv cpha0 qspi slv cpha1 ss input 13 12 4 12 5 11 12 6 10 9 8 data slave lsb out pd msb out msb in data lsb in 7 4 1 2 10 pd 13 3 miso output sck cpol=1 input mosi input sck cpol=0 input 336376umbook page 25 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-26 user? manual figure a-20 tpu timing diagram notes: 1. ac timing is shown with respect to 20% v dd and 70% v dd levels. 2. timing not valid for external t2clk input. 3. maximum load capacitance for clkout pin is 90 pf. 4. maximum load capacitance for tpu output pins is 100 pf. table a-10 time processor unit timing (v dd and v ddsyn = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h , f sys = 20.97 mhz) 1 , 2 num rating symbol min max unit 1 clkout high to tpu output channel valid 3, 4 t chtov 218ns 2 clkout high to tpu output channel hold t chtoh 015ns 3 tpu input channel pulse width t tipw 4t cyc tpu i/o tim clkout tpu output tpu input 2 1 3 336376umbook page 26 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-27 notes: 1. below disruptive current conditions, the channel being stressed has conversion values of $3ff for analog inputs greater than v rh and $000 for values less than v rl . this assumes that v rh v dda and v rl 3 v ssa due to the presence of the sample amplifier. other channels are not affected by non-disruptive conditions. 2. input signals with large slew rates or high frequency noise components cannot be converted accurately. these signals also affect the conversion accuracy of other channels. 3. exceeding limit may cause conversion error on stressed channels and on unstressed channels. transitions within the limit do not affect device reliability or cause permanent damage. 4. input must be current limited to the value specified. to determine the value of the required current-limiting re- sistor, calculate resistance values using positive and negative clamp values, then use the larger of the calculat- ed values. 5. this parameter is periodically sampled rather 100% tested. 6. condition applies to one pin at a time. 7. determination of actual maximum disruptive input current, which can affect operation, is related to external sys- tem component values. 8. current coupling is the ratio of the current induced from overvoltage (positive or negative, through an external series coupling resistor), divided by the current induced on adjacent pins. a voltage drop may occur across the external source impedances of the adjacent pins, impacting conversions on these adjacent pins. table a-11 qadc maximum ratings num parameter symbol min max unit 1 analog supply, with reference to v ssa v dda ?0.3 6.5 v 2 internal digital supply, with reference to v ssi v ddi ?0.3 6.5 v 3 reference supply, with reference to v rl v rh ?0.3 6.5 v 4 v ss differential voltage v ssi ?v ssa ?0.1 0.1 v 5 v dd differential voltage v ddi ?v dda ?6.5 6.5 v 6 v ref differential voltage v rh ?v rl ?6.5 6.5 v 7 v rh to v dda differential voltage v rh ?v dda ?6.5 6.5 v 8 v rl to v ssa differential voltage v rl ?v ssa ?6.5 6.5 v 9 disruptive input current 1, 2, 3, 4, 5, 6, 7 v negclamp = ?0.3 v v posclamp = 8 v i na ?500 500 m a 10 positive overvoltage current coupling ratio 1, 5, 6, 8 pqa pqb k p 2000 2000 11 negative overvoltage current coupling ratio 1, 5, 6, 8 pqa pqb k n 125 500 12 maximum input current 3, 4, 6 v negclamp = ?0.3 v v posclamp = 8 v i ma ?25 25 ma 336376umbook page 27 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-28 user? manual notes: 1. refers to operation over full temperature and frequency range. 2. to obtain full-scale, full-range results, v ssa v rl v indc v rh v dda . 3. accuracy tested and guaranteed at v rh ?v rl = 5.0v 10%. 4. parameter applies to the following pins: port a: pqa[7:0]/an[59:58]/etrig[2:1] port b: pqb[7:0]/an[3:0]/an[51:48]/an[z:w] 5. open drain only. 6. current measured at maximum system clock frequency with qadc active. 7. maximum leakage occurs at maximum operating temperature. current decreases by approximately one-half for each 10 c decrease from maximum temperature. 8. this parameter is periodically sampled rather than 100% tested. table a-12 qadc dc electrical characteristics (operating) (v ssi and v ssa = 0vdc, f qclk = 2.1 mhz, t a = t l to t h ) num parameter symbol min max unit 1 analog supply 1 v dda 4.5 5.5 v 2 internal digital supply 1 v ddi 4.5 5.5 v 3 v ss differential voltage v ssi v ssa ?1.0 1.0 mv 4 v dd differential voltage v ddi ?v dda ?1.0 1.0 v 5 reference voltage low 2 v rl v ssa ? 6 reference voltage high 2 v rh ? dda v 7 v ref differential voltage 3 v rh ?v rl 4.5 5.5 v 8 mid-analog supply voltage v dda /2 2.25 2.75 v 9 input voltage v indc v ssa v dda v 10 input high voltage, pqa and pqb v ih 0.7 (v dda )v dda + 0.3 v 11 input low voltage, pqa and pqb v il v ssa ?0.3 0.2 (v dda )v 12 input hysteresis 4 v hys 0.5 v 13 output low voltage, pqa 5 i ol = 5.3 ma i ol = 10.0 m a v ol 0.4 0.2 v 14 analog supply current normal operation 6 low-power stop i dda 1.0 10.0 ma m a 15 reference supply current i ref 150 m a 16 load capacitance, pqa c l ?0pf 17 input current, channel off 7 pqa pqb i off 250 150 na 18 total input capacitance 8 pqa not sampling pqa sampling pqb not sampling pqb sampling c in 15 20 10 15 pf 336376umbook page 28 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-29 notes: 1. conversion characteristics vary with f qclk rate. reduced conversion accuracy occurs at max f qclk rate. 2. duty cycle must be as close as possible to 75% to achieve optimum performance. 3. minimum applies to 1.0 mhz operation. 4. assumes that short input sample time has been selected (ist = 0). 5. assumes that f sys = 20.97 mhz. 6. assumes f qclk = 0.999 mhz, with clock prescaler values of: qacr0: psh = %01111, psa = %1, psl = 100) ccw: byp = %0 7. assumes f qclk = 2.097 mhz, with clock prescaler values of: qacr0: psh = %00110, psa = %1, psl = 010) ccw: byp = %0 table a-13 qadc ac electrical characteristics (operating) (v ddi and v dda = 5.0 vdc 5%, v ssi and v ssa = 0vdc, t a = t l to t h ) num parameter symbol min max unit 1 qadc clock (qclk) frequency 1 f qclk 0.5 2.1 mhz 2 qadc clock duty cycle 2, 3 high phase time (t psl t psh ) t psh 500 ns 3 conversion cycles 4 cc 18 32 qclk cycles 4 conversion time 2,4,5 f qclk = 0.999 mhz 6 min = ccw/ist = %00 max = ccw/ist = %11 f qclk = 2.097 mhz 1, 7 min = ccw/ist = %00 max = ccw/ist = %11 t conv 18.0 8.58 32 15.24 m s 5 stop mode recovery time t sr ?0 m s 336376umbook page 29 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-30 user? manual notes: 1. at v rh ?v rl = 5.12 v, one count = 5 mv. 2. this parameter is periodically sampled rather than 100% tested. 3. absolute error includes 1/2 count (2.5 mv) of inherent quantization error and circuit (differential, integral, and offset) error. specification assumes that adequate low-pass filtering is present on analog input pins ?capacitive filter with 0.01 m f to 0.1 m f capacitor between analog input and analog ground, typical source isolation impedance of 20 k w . 4. assumes f sys = 20.97 mhz. 5. assumes clock prescaler values of: qacr0: psh = %01111, psa = %1, psl = 100) ccw: byp = %0 6. assumes clock prescaler values of: qacr0: psh = %00110, psa = %1, psl = 010) ccw: byp = %0 7. maximum source impedance is application-dependent. error resulting from pin leakage depends on junction leakage into the pin and on leakage due to charge-sharing with internal capacitance. error from junction leakage is a function of external source impedance and input leakage current. in the following expression, expected error in result value due to junction leakage is expressed in voltage (v errj ): v errj = r s x i off where i off is a function of operating temperature. refer to table a-12 . charge-sharing leakage is a function of input source impedance, conversion rate, change in voltage between successive conversions, and the size of the decoupling capacitor used. error levels are best determined empirically. in general, continuous conversion of the same channel may not be compatible with high source impedance. table a-14 qadc conversion characteristics (operating) (v ddi and v dda = 5.0 vdc 5%, v ssi and v ssa = 0 vdc, t a = t l to t h , 0.5 mhz f qclk 2.1 mhz, 2 clock input sample time) num parameter symbol min typ max unit 1 resolution 1 1 count 5 mv 2 differential nonlinearity 2 dnl 0.5 counts 3 integral nonlinearity inl 2.0 counts 4 absolute error 2, 3, 4 f qclk = 0.999 mhz 5 pqa pqb f qclk = 2.097 mhz 6 pqa pqb ae 2.5 2.5 4.0 4.0 counts 5 source impedance at input 7 r s ?0k w 336376umbook page 30 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-31 notes: 1. value applies when using external clock. 2. value applies when using internal clock. minimum counter resolution depends on prescaler divide ratio selection. notes: 1. value applies when using external clock. 2. value applies when using internal clock. minimum counter resolution depends on prescaler divide ratio selection. table a-15 fcsm timing characteristics (v dd = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) num parameter symbol min max unit 1 input pin frequency 1 f pcntr 0f sys /4 mhz 2 input pin low time t pinl 2.0/f sys m s 3 input pin high time t pinh 2.0/ f sys m s 4 clock pin to counter increment t pinc 4.5/f sys 6.5/f sys m s 5 clock pin to new tbb value t ptbb 5.0/f sys 7.0/f sys m s 6 clock pin to cof set ($ffff) t pcof 4.5/f sys 6.5/f sys m s 7 pin to in bit delay t pinb 1.5/f sys 2.5/f sys m s 8 flag to imb interrupt request t firq 1.0/f sys 1.0/f sys m s 9 counter resolution 2 t cres 2.0/f sys m s table a-16 mcsm timing characteristics (v dd = 5.0 vdc 5%, v ss = 0vdc, t a = t l to t h ) num parameter symbol min max unit 1 input pin frequency 1 f pcntr 0f sys /4 mhz 2 input pin low time t pinl 2.0/f sys m s 3 input pin high time t pinh 2.0/f sys m s 4 clock pin to counter increment t pinc 4.5/f sys 6.5/f sys m s 5 clock pin to new tbb value t ptbb 5.0/f sys 7.0/f sys m s 6 clock pin to cof set ($ffff) t pcof 4.5/f sys 6.5/f sys m s 7 load pin to new counter value t pload 2.5/f sys 3.5/f sys m s 8 pin to in bit delay t pinb 1.5/f sys 2.5/f sys m s 9 flag to imb interrupt request t firq 1.0/f sys 1.0/f sys m s 10 counter resolution 2 t cres 2.0/f sys m s 336376umbook page 31 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-32 user? manual notes: 1. minimum resolution depends on counter and prescaler divide ratio selection. 2. time given from when new value is stable on time base bus. table a-17 sasm timing characteristics (v dd = 5.0 vdc 5%, v ss = 0vdc, t a = t l to t h ) num parameter symbol min max unit 1 input pin low time t pinl 2.0/f sys m s 2 input pin high time t pinh 2.0/f sys m s 3 input capture resolution 1 t resca 2.0/f sys m s 4 pin to input capture delay t pcapt 2.5/f sys 4.5/f sys m s 5 pin to flag set t pflag 2.5/f sys 4.5/f sys m s 6 pin to in bit delay t pinb 1.5/f sys 2.5/f sys m s 7 oct output pulse t oct 2.0/f sys m s 8 compare resolution t rescm 2.0/f sys m s 9 tbb change to flag set t cflag 1.5/f sys 1.5/f sys m s 10 tbb change to pin change 2 t cpin 1.5/f sys 1.5/f sys m s 11 flag to imb interrupt request t firq 1.0/f sys 1.0/f sys m s 336376umbook page 32 friday, november 15, 1996 2:09 pm
MC68336/376 electrical characteristics motorola user? manual a-33 notes: 1. minimum resolution depends on counter and prescaler divide ratio selection. 2. time given from when new value is stable on time base bus. table a-18 dasm timing characteristics (v dd = 5.0 vdc 5%, v ss = 0 vdc, t a = t l to t h ) num parameter symbol min max unit 1 input pin low time t pinl 2.0/f sys m s 2 input pin high time t pinh 2.0/f sys m s 3 input capture resolution 1 t resca 2.0/f sys m s 4 pin to input capture delay t pcapt 2.5/f sys 4.5/f sys m s 5 pin to flag set t pflag 2.5/f sys 4.5/f sys m s 6 pin to in bit delay t pinb 1.5/f sys 2.5/f sys m s 7 oct output pulse t oct 2.0/f sys m s 8 compare resolution t rescm 2.0/f sys m s 9 tbb change to flag set t cflag 1.5/f sys 1.5/f sys m s 10 tbb change to pin change 2 t cpin 1.5/f sys 1.5/f sys m s 11 flag to imb interrupt request t firq 1.0/f sys 1.0/f sys m s 336376umbook page 33 friday, november 15, 1996 2:09 pm
motorola electrical characteristics MC68336/376 a-34 user? manual notes: 1. minimum output resolution depends on counter and prescaler divide ratio selection. 2. excluding the case where the output is always zero. 3. excluding the case where the output is always zero. table a-19 pwmsm timing characteristics (v dd = 5.0vdc 5%, v ss = 0 vdc, t a = t l to t h ) num parameter symbol min max unit 1 pwmsm output resolution 1 t pwmr m s 2 pwmsm output pulse 2 t pwmo 2.0/f sys m s 3 pwmsm output pulse 3 t pwmo 2.0/f sys 2.0/f sys m s 4 cpsm enable to output set pwmsm enabled before cpsm , div23 = 0 pwmsm enabled before cpsm , div23 = 1 t pwmp 3.5/f sys 6.5/f sys m s 5 pwm enable to output set pwmsm enabled before cpsm , div23 = 0 pwmsm enabled before cpsm , div23 = 1 t pwme 3.5/f sys 5.5/f sys 4.5/f sys 6.5/f sys m s 6 flag to imb interrupt request t firq 1.5/f sys 2.5/f sys m s 336376umbook page 34 friday, november 15, 1996 2:09 pm
MC68336/376 mechanical data and ordering information motorola user? manual b-1 appendix b mechanical data and ordering information the MC68336 and the mc68376 are both available in 160-pin plastic surface mount packages. this appendix provides package pin assignment drawings, a dimensional drawing and ordering information. figure b-1 MC68336 pin assignments for 160-pin package 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 *nc ctm2c ctd3 ctd4 cpwm5 cpwm6 cpwm7 cpwm8 ctd9 ctd10 tpuch0 vss tpuch1 tpuch2 vdd tpuch3 tpuch4 tpuch5 tpuch6 vss vdd tpuch7 tpuch8 tpuch9 tpuch10 vstby vss tpuch11 tpuch12 vdd tpuch13 tpuch14 tpuch15 t2clk pc6/addr22/cs9 pc5/addr21/cs8 pc4/addr20/cs7 pc3/addr19/cs6 vss vdd pc2/fc2/cs5 pc1/fc1/cs4 fc0/cs3 bga ck /cs2 bg /cs1 br /cs0 csboo t data0 data1 data2 vss data3 data4 vdd data5 data6 data7 data8 vss data9 data10 data11 data12 data13 vss data14 data15 vdd addr0 pe0/dsa ck0 pe1/dsa ck1 pe2/a vec pe3/rmc pe4/ds pe5/as pe6/siz0 pe7/siz1 r/w vss addr23/cs10 /eclk *nc rxd txd/pqs7 pcs3/pqs6 pcs2/pqs5 pcs1/pqs4 pcs0/ss /pqs3 sck/pqs2 mosi/pqs1 miso/pqs0 addr1 vdd addr2 addr3 vss addr4 addr5 addr6 addr7 vss addr8 addr9 addr10 addr11 addr12 addr13 addr14 addr15 addr16 vdd addr17 addr18 vss an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 vrh vrl vssa vdda an52/ma0/pqa0 an53/ma1/pqa1 an54/ma2/pqa2 an55/etrig1/pqa3 an56/etrig2/pqa4 an57/pqa5 an57/pqa6 an59/pqa7 vss xtal vddsyn extal vss vdd xfc vdd vss clkout ipipe /dso ifetch /dsi freeze/quot bkpt /dsclk tstme /tsc reset hal t berr pf7/irq7 pf6/irq6 pf5/irq5 pf4/irq4 pf3/irq3 pf2/irq2 pf1/irq1 pf0/modclk vdd 336 160-pin qfp MC68336 *note: MC68336 revision d and later (f60k and later mask sets) have assigned pins 1 and 160 as ?o connect? to allow pin compatibility with the mc68376. for revision c (d65j mask set) devices, pin 1 is v ss and pin 160 is v dd . 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola mechanical data and ordering information MC68336/376 b-2 user? manual figure b-2 mc68376 pin assignments for 160-pin package 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 canrx0 ctm2c ctd3 ctd4 cpwm5 cpwm6 cpwm7 cpwm8 ctd9 ctd10 tpuch0 vss tpuch1 tpuch2 vdd tpuch3 tpuch4 tpuch5 tpuch6 vss vdd tpuch7 tpuch8 tpuch9 tpuch10 vstby vss tpuch11 tpuch12 vdd tpuch13 tpuch14 tpuch15 t2clk pc6/addr22/cs9 pc5/addr21/cs8 pc4/addr20/cs7 pc3/addr19/cs6 vss vdd pc2/fc2/cs5 pc1/fc1/cs4 fc0/cs3 bga ck /cs2 bg /cs1 br /cs0 csboo t data0 data1 data2 vss data3 data4 vdd data5 data6 data7 data8 vss data9 data10 data11 data12 data13 vss data14 data15 vdd addr0 pe0/dsa ck0 pe1/dsa ck1 pe2/a vec pe3/rmc pe4/ds pe5/as pe6/siz0 pe7/siz1 r/w vss addr23/cs10 /eclk cantx0 rxd txd/pqs7 pcs3/pqs6 pcs2/pqs5 pcs1/pqs4 pcs0/ss /pqs3 sck/pqs2 mosi/pqs1 miso/pqs0 addr1 vdd addr2 addr3 vss addr4 addr5 addr6 addr7 vss addr8 addr9 addr10 addr11 addr12 addr13 addr14 addr15 addr16 vdd addr17 addr18 vss an0/anw/pqb0 an1/anx/pqb1 an2/any/pqb2 an3/anz/pqb3 an48/pqb4 an49/pqb5 an50/pqb6 an51/pqb7 vrh vrl vssa vdda an52/ma0/pqa0 an53/ma1/pqa1 an54/ma2/pqa2 an55/etrig1/pqa3 an56/etrig2/pqa4 an57/pqa5 an57/pqa6 an59/pqa7 vss xtal vddsyn extal vss vdd xfc vdd vss clkout ipipe /dso ifetch /dsi freeze/quot bkpt /dsclk tstme /tsc reset hal t berr pf7/irq7 pf6/irq6 pf5/irq5 pf4/irq4 pf3/irq3 pf2/irq2 pf1/irq1 pf0/modclk vdd 376 160-pin qfp mc68376 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 mechanical data and ordering information motorola user? manual b-3 figure b-3 160-pin package dimensions ????? ????? ????? detail c h b a d l y detail a b v l z a s !      !     !      !  !      !  !      !  detail a g p a, b, d b b h c e c m u w k x q r t h          !   
   !  d n f j base metal section bb detail c "!  !  "   ! '      "  ! " 
 "#   ! " " ""    ! " %" "  %  "  &"! " !" ' " " ""  "  "   "#!     "  "  " "#    !! !  $ "  "  " !"    !!     " #   " #! %  " #! !    ! !!     #  !"    "  " "#    !  ! " #   " #! %   " #! !   
 ""  &!!  "  ! " &# "  "  "  "  " % #!  " "                  


 
   
   
 
   
   
 
  !      
 
 
      

                
! 
!       

   

    
 
        

    
          
   
      
           top & bottom case outline 864a-03 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola mechanical data and ordering information MC68336/376 b-4 user? manual b.1 obtaining updated MC68336/376 mechanical information although all devices manufactured by motorola conform to current jedec standards, complete mechanical information regarding MC68336/376 microcontrollers is avail- able through motorola? design-net. to download updated package specifications, perform the following steps: 1. visit the design-net case outline database search engine at http://design-net.com/cgi-bin/cases. 2. enter the case outline number, located in figure b-3 without the revision code (for example, 864a, not 864a-03) in the field next to the search button. 3. download the file with the new package diagram. b.2 ordering information refer to table b-1 for MC68336 ordering information and table b-2 for mc68376 ordering information. contact a motorola sales representative for information on order- ing a custom rom device. table b-1 MC68336 ordering information part number package type frequency (mhz) tpu temperature package order quantity order number MC68336 160-pin qfp 20.97 mhz a ?0 to +85 c 2 spMC68336acft20 24 MC68336acft20 120 MC68336acft20b1 e40 to +105 c 2 spMC68336avft20 24 MC68336avft20 120 MC68336avft20b1 e40 to +125 c 2 spMC68336amft20 24 MC68336amft20 120 MC68336amft20b1 g e40 to +85 c 2 spMC68336gcft20 24 MC68336gcft20 120 MC68336gcft20b1 e40 to +105 c 2 spMC68336gvft20 24 MC68336gvft20 120 MC68336gvft20b1 e40 to +125 c 2 spMC68336gmft20 24 MC68336gmft20 120 MC68336gmft20b1 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 mechanical data and ordering information motorola user? manual b-5 table b-2 mc68376 ordering information part number package type frequency (mhz) tpu mask rom temperature package order quantity order number mc68376 160-pin qfp 20.97 mhz a blank ?0 to +85 c 2 spmc68376bacft20 24 mc68376bacft20 120 mc68376bacft20b1 e40 to +105 c 2 spmc68376bavft20 24 mc68376bavft20 120 mc68376bavft20b1 e40 to +125 c 2 spmc68376bamft20 24 mc68376bamft20 120 mc68376bamft20b1 g blank e40 to +85 c 2 spmc68376bgcft20 24 mc68376bgcft20 120 mc68376bgcft20b1 e40 to +105 c 2 spmc68376bgvft20 24 mc68376bgvft20 120 mc68376bgvft20b1 e40 to +125 c 2 spmc68376bgmft20 24 mc68376bgmft20 120 mc68376bgmft20b1 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola mechanical data and ordering information MC68336/376 b-6 user? manual 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 development support motorola user? manual c-1 appendix c development support this section serves as a brief reference to motorola development tools for MC68336 and mc68376 microcontrollers. information provided is complete as of the time of publication, but new systems and software are continually being developed. in addition, there is a growing number of third-party tools available. the motorola microcontroller development tools directory (mcudevtldir/d revision. 3) provides an up-to-date list of development tools. con- tact your motorola representative for further information. c.1 m68mmds1632 modular development system the m68mmds1632 motorola modular development system (mmds) is a develop- ment tool for evaluating m68hc16 and m68300 mcu-based systems. the mmds1632 is an emulator, bus state analyzer, and control station for debugging hard- ware and software. a separately purchased mpb completes mmds functionality with regard to a particular mcu or mcu family. the many mpbs available let your mmds emulate a variety of different mcus. contact your motorola sales representative, who will assist you in selecting and configuring the modular system that fits your needs. a full-featured development system, the mmds provides both in-circuit emulation and bus analysis capabilities, including: ?real-time in-circuit emulation at maximum speed of 20 mhz ?built-in emulation memory ?1-mbyte main emulation memory (three-clock bus cycle) ?256-kbyte fast termination (two-clock bus cycle) ?4-kbyte dual-port emulation memory (three-clock bus cycle) ?real-time bus analysis ?instruction disassembly ?state-machine-controlled triggering ?four hardware breakpoints, bitwise masking ?analog/digital emulation ?synchronized signal output ?built-in ac power supply, 90?64 v, 50?0 hz, fcc and ec emi compliant ?rs-232 connection to host capable of communicating at 1200, 2400, 4800, 9600, 19200, 38400, or 57600 baud c.2 m68mevb1632 modular evaluation board the m68mevb1632 modular evaluation board (mevb) is a development tool for eval- uating m68hc16 and m68300 mcu-based systems. the mevb consists of the m68mpfb1632 modular platform board, an mcu personality board (mpb), an in- circuit debugger (icd16 or icd32), and development software. mevb features in- clude: 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola development support MC68336/376 c-2 user? manual ?an economical means of evaluating target systems incorporating m68hc16 and m68300 hcmos mcu devices. ?expansion memory sockets for installing ram, eprom, or eeprom. ?data ram: 32k x 16, 128k x 16, or 512k x 16 ?eprom/eeprom: 32k x 16, 64k x 16, 128k x 16, 256k x 16, or 512k x 16 ?fast ram: 32k x 16 or 128k x 16 ?background-mode operation, for detailed operation from a personal computer platform without an on-board monitor. ?integrated assembly/editing/evaluation/programming environment for easy de- velopment. ?as many as seven software breakpoints. ?re-usable icd hardware for your target application debug or control. ?two rs-232c terminal input/output (i/o) ports for user evaluation of the serial communication interface. ?logic analyzer pod connectors. ?port replacement unit (pru) to rebuild i/o ports lost to address/data/control. ?on-board v pp (+12 vdc) generation for mcu and flash eeprom programming. ?on-board wire-wrap area. 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-1 appendix d register summary this appendix contains address maps, register diagrams, and bit/field definitions for MC68336 and mc68376 microcontrollers. more detailed information about register function is provided in the appropriate sections of the manual. except for central processing unit resources, information is presented in the intermod- ule bus address order shown in table d-1 . control registers for all the modules in the microcontroller are mapped into a 4-kbyte block. the state of the module mapping (mm) bit in the sim configuration register (simcr) determines where the control register block is located in the system memory map. when mm = 0, register addresses range from $7ff000 to $7fffff; when mm = 1, register addresses range from $fff000 to $ffffff. in the module memory maps in this appendix, the ?ccess?column specifies which registers are accessible when the cpu32 is in supervisor mode only and which regis- ters can be assigned to either supervisor or user mode. d.1 central processor unit cpu32 registers are not part of the module address map. figures d-1 and d-2 show a functional representation of cpu32 resources. table d-1 module address map module size (bytes) base address sim 128 $yffa00 sram 8 $yffb40 mrm (mc68376 only) 32 $yff820 qadc 512 $yff200 qsm 512 $yffc00 ctm4 256 $yff400 tpu 512 $yffe00 tpuram 64 $yffb00 toucan (mc68376 only) 384 $yff080 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-2 user? manual d.1.1 cpu32 register model figure d-1 user programming model 16 31 15 0 87 d0 d2 d4 d6 d7 data registers address registers cpu32 user prog model 16 31 15 0 d1 d3 d5 a0 a1 a2 a3 a4 a5 a6 16 31 15 0 a7 (ssp) user stack pointer 31 0 pc program counter ccr condition code register 0 7 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-3 figure d-2 supervisor programming model supplement d.1.2 status register the status register (sr) contains condition codes, an interrupt priority mask, and three control bits. the condition codes are contained in the condition code register (ccr), the lower byte of the sr. (the lower and upper bytes of the status register are also referred to as the user and system bytes, respectively.) in user mode, only the ccr is available. in supervisor mode, software can access the full status register. t[1:0] ?trace enable this field places the processor in one of two tracing modes or disables tracing. refer to table d-2 . sr ?status register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 t[1:0] s 0 0 ip[2:0] 0 0 0 x n z v c reset: 0 0 1 0 0 1 1 1 0 0 0 u u u u u table d-2 t[1:0] encoding t[1:0] response 00 no tracing 01 trace on change of flow 10 trace on instruction execution 11 undefined; reserved 16 31 15 0 15 0 87 (ccr) 31 0 0 2 a7?(ssp) sr vbr sfc dfc supervisor stack pointer status register vector base register alternate function code registers cpu32 supv prog model 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-4 user? manual s ?supervisor/user state 0 = cpu operates at user privilege level 1 = cpu operates at supervisor privilege level ip[2:0] ?interrupt priority mask the priority value in this field (0 to 7) is used to mask interrupts. x ?extend flag used in multiple-precision arithmetic operations. in many instructions, it is set to the same value as the c bit. n ?negative flag set when the msb of a result register is set. z ?zero flag set when all bits of a result register are zero. v ?overflow flag set when two's complement overflow occurs as the result of an operation. c ?carry flag set when a carry or borrow occurs during an arithmetic operation. also used during shift and rotate instructions to facilitate multiple word operations. 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-5 d.2 system integration module table d-3 shows the sim address map. the column labeled ?ccess?indicates the privilege level at which the cpu32 must be operating to access the register. a designation of ??indicates that supervisor mode is required. a designation of ?/u indicates that the register can be programmed for either supervisor mode access or unrestricted access. table d-3 sim address map access address 1 15 8 7 0 s $yffa00 sim module configuration register (simcr) s $yffa02 sim test register (simtr) s $yffa04 clock synthesizer control register (syncr) s $yffa06 not used reset status register (rsr) s $yffa08 sim test register e (simtre) s $yffa0a not used s $yffa0c not used s $yffa0e not used s/u $yffa10 not used port e data (porte0) s/u $yffa12 not used port e data (porte1) s/u $yffa14 not used port e data direction (ddre) s $yffa16 not used port e pin assignment (pepar) s/u $yffa18 not used port f data (portf0) s/u $yffa1a not used port f data (portf1) s/u $yffa1c not used port f data direction (ddrf) s $yffa1e not used port f pin assignment (pfpar) s $yffa20 not used system protection control (sypcr) s $yffa22 periodic interrupt control register (picr) s $yffa24 periodic interrupt timing register (pitr) s $yffa26 not used software service (swsr) s $yffa28 not used s $yffa2a not used s $yffa2c not used s $yffa2e not used s $yffa30 test module master shift a (tstmsra) s $yffa32 test module master shift b (tstmsrb) s $yffa34 test module shift count (tstsc) s $yffa36 test module repetition counter (tstrc) s $yffa38 test module control (creg) s/u $yffa3a test module distributed (dreg) $yffa3c not used $yffa3e not used s/u $yffa40 not used port c data (portc) $yffa42 not used s $yffa44 chip-select pin assignment (cspar0) s $yffa46 chip-select pin assignment (cspar1) s $yffa48 chip-select base boot (csbarbt) s $yffa4a chip-select option boot (csorbt) s $yffa4c chip-select base 0 (csbar0) s $yffa4e chip-select option 0 (csor0) 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-6 user? manual d.2.1 sim configuration register simcr controls system configuration. simcr can be read or written at any time, ex- cept for the module mapping (mm) bit, which can only be written once. exoff ?external clock off 0 = the clkout pin is driven during normal operation. 1 = the clkout pin is placed in a high-impedance state. notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. notes: 1. this bit must be left at zero. pulling data11 high during reset ensures this bit remains zero. a one in this bit could allow the mcu to enter an unsupported operating mode. s $yffa50 chip-select base 1 (csbar1) s $yffa52 chip-select option 1 (csor1) s $yffa54 chip-select base 2 (csbar2) s $yffa56 chip-select option 2 (csor2) s $yffa58 chip-select base 3 (csbar3) s $yffa5a chip-select option 3 (csor3) s $yffa5c chip-select base 4 (csbar4) s $yffa5e chip-select option 4 (csor4) s $yffa60 chip-select base 5 (csbar5) s $yffa62 chip-select option 5 (csor5) s $yffa64 chip-select base 6 (csbar6) s $yffa66 chip-select option 6 (csor6) s $yffa68 chip-select base 7 (csbar7) s $yffa6a chip-select option 7 (csor7) s $yffa6c chip-select base 8 (csbar8) s $yffa6e chip-select option 8 (csor8) s $yffa70 chip-select base 9 (csbar9) s $yffa72 chip-select option 9 (csor9) s $yffa74 chip-select base 10 (csbar10) s $yffa76 chip-select option 10 (csor10) $yffa78 not used $yffa7a not used $yffa7c not used $yffa7e not used simcr sim configuration register $tffa00 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exoff frzsw frzbm 0 rsvd 1 0 shen[1:0] supv mm 0 0 iarb[3:0] reset: 0 0 0 0 data11 0 0 0 1 1 0 0 1 1 1 1 table d-3 sim address map (continued) access address 1 15 8 7 0 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-7 frzsw ?freeze software enable 0 = when freeze is asserted, the software watchdog and periodic interrupt timer counters continue to run. 1 = when freeze is asserted, the software watchdog and periodic interrupt timer counters are disabled, preventing interrupts during background debug mode. frzbm ?freeze bus monitor enable 0 = when freeze is asserted, the bus monitor continues to operate. 1 = when freeze is asserted, the bus monitor is disabled. shen[1:0] ?show cycle enable the shen field determines how the external bus is driven during internal transfer operations. a show cycle allows internal transfers to be monitored externally. table d-4 shows whether show cycle data is driven externally, and whether external bus arbitration can occur. to prevent bus conflict, external peripherals must not be en- abled during show cycles. supv ?supervisor/unrestricted data space the supv bit places the sim global registers in either supervisor or user data space. 0 = registers with access controlled by the supv bit are accessible in either supervisor or user mode. 1 = registers with access controlled by the supv bit are restricted to supervisor access only. mm ?module mapping 0 = internal modules are addressed from $7ff000 ?$7fffff. 1 = internal modules are addressed from $fff000 ?$ffffff. iarb[3:0] ?interrupt arbitration id each module that can generate interrupts, including the sim, has an iarb field. each iarb field can be assigned a value from $0 to $f. during an interrupt acknowledge cycle, iarb permits arbitration among simultaneous interrupts of the same priority lev- el. the reset value of the sim iarb field is $f. this prevents sim interrupts from being discarded during system initialization. d.2.2 system integration test register simtr system integration test register $yffa02 used for factory test only. table d-4 show cycle enable bits shen[1:0] action 00 show cycles disabled, external arbitration enabled 01 show cycles enabled, external arbitration disabled 10 show cycles enabled, external arbitration enabled 11 show cycles enabled, external arbitration enabled; internal activity is halted by a bus grant 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-8 user? manual d.2.3 clock synthesizer control register syncr determines system clock operating frequency and operation during low-power stop mode. clock frequency is determined by syncr bit settings as follows: w ?frequency control (vco) this bit controls a prescaler tap in the synthesizer feedback loop. setting this bit increases the vco speed by a factor of four. vco relock delay is required. x ?frequency control (prescaler) this bit controls a divide by two prescaler that is not in the synthesizer feedback loop. setting the bit doubles clock speed without changing the vco speed. no vco relock delay is required. y[5:0] ?frequency control (counter) the y field controls the modulus down counter in the synthesizer feedback loop, caus- ing it to divide by a value of y + 1. vco relock delay is required. ediv ?e clock divide rate 0 = eclk frequency is system clock divided by 8. 1 = eclk frequency is system clock divided by 16. eclk is an external m6800 bus clock available on addr23. slock ?synthesizer lock flag 0 = vco is enabled, but has not locked. 1 = vco has locked on the desired frequency or vco is disabled. the mcu remains in reset until the synthesizer locks, but slock does not indicate synthesizer lock status until after the user writes to syncr. stsim ?stop mode sim clock 0 = when lpstop is executed, the sim clock is driven from the crystal oscillator and the vco is turned off to conserve power. 1 = when lpstop is executed, the sim clock is driven from the vco. notes: 1. ensure that initialization software does not change the value of these bits. they should always be zero. syncr clock synthesizer control register $yffa04 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 w x y[5:0] ediv 0 0 rsvd 1 slock rsvd 1 stsim stext reset: 0 0 1 1 1 1 1 1 0 0 0 0 u 0 0 0 f sys f ref 128 --------- - 4y 1 + () 2 2w x + () () [] = 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-9 stext ?stop mode external clock 0 = when lpstop is executed, the clkout signal is held negated to conserve power. 1 = when lpstop is executed and exoff 1 1 in simcr, the clkout signal is driven from the sim clock, as determined by the state of the stsim bit. d.2.4 reset status register rsr contains a status bit for each reset source in the mcu. rsr is updated when the mcu comes out of reset. a set bit indicates what type of reset occurred. if multiple sources assert reset signals at the same time, more than one bit in rsr may be set. this register can be read at any time; writes have no effect. ext ?external reset reset caused by the reset pin. pow ?power-up reset reset caused by the power-up reset circuit. sw ?software watchdog reset reset caused by the software watchdog circuit. hlt ?halt monitor reset reset caused by the halt monitor. sys ?system reset reset caused by a reset instruction. tst ?test submodule reset reset caused by the test submodule. used during system test only. d.2.5 system integration test register (eclk) simtre system integration test register (eclk) $yffa08 used for factory test only. rsr reset status register $yffa07 15 8 7 6 5 4 3 2 1 0 not used ext pow sw hlt 0 rsvd sys tst 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-10 user? manual d.2.6 port e data register porte is an internal data latch that can be accessed at two locations. it can be read or written at any time. if a port e i/o pin is configured as an output, the corresponding bit value is driven out on the pin. when a pin is configured as an output, a read of porte returns the latched bit value; when a pin is configured as an input, a read returns the pin logic level. d.2.7 port e data direction register bits in this register control the direction of the port e pin drivers when pins are config- ured for i/o. setting a bit configures the corresponding pin as an output; clearing a bit configures the corresponding pin as an input. this register can be read or written at any time. d.2.8 port e pin assignment register bits in this register determine the function of port e pins. setting a bit assigns the cor- responding pin to a bus control signal; clearing a bit assigns the pin to i/o port e. refer to table d-5 . porte0 port e0 data register $yffa11 porte1 port e1 data register $yffa13 15 8 7 6 5 4 3 2 1 0 not used pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 reset: u u u u u u u u ddre port e data direction register $yffa15 15 8 7 6 5 4 3 2 1 0 not used dde7 dde6 dde5 dde4 dde3 dde2 dde1 dde0 reset: 0 0 0 0 0 0 0 0 pepar port e pin assignment $yffa17 15 8 7 6 5 4 3 2 1 0 not used pepa7 pepa6 pepa5 pepa4 pepa3 pepa2 pepa1 pepa0 reset: data8 data8 data8 data8 data8 data8 data8 data8 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-11 d.2.9 port f data register portf is an internal data latch that can be accessed at two locations. it can be read or written at any time. if a port f i/o pin is configured as an output, the corresponding bit value is driven out on the pin. when a pin is configured as an output, a read of portf returns the latched bit value; when a pin is configured as an input, a read returns the pin logic level. d.2.10 port f data direction register bits in this register control the direction of the port f pin drivers when pins are config- ured for i/o. setting a bit configures the corresponding pin as an output; clearing a bit configures the corresponding pin as an input. this register can be read or written at any time. d.2.11 port f pin assignment register table d-5 port e pin assignments pepar bit port e signal bus control signal pepa7 pe7 siz1 pepa6 pe6 siz0 pepa5 pe5 as pepa4 pe4 ds pepa3 pe3 rmc pepa2 pe2 avec pepa1 pe1 dsack1 pepa0 pe0 dsack0 portf0 port f data register 0 $yffa19 portf1 port f data register 1 $yffa1b 15 8 7 6 5 4 3 2 1 0 not used pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 reset: u u u u u u u u ddrf port f data direction register $yffa1d 15 8 7 6 5 4 3 2 1 0 not used ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 reset: 0 0 0 0 0 0 0 0 pfpar port f pin assignment register $yffa1f 15 8 7 6 5 4 3 2 1 0 not used pfpa7 pfpa6 pfpa5 pfpa4 pfpa3 pfpa2 pfpa1 pfpa0 reset: data9 data9 data9 data9 data9 data9 data9 data9 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-12 user? manual bits in this register determine the function of port f pins. setting a bit assigns the corresponding pin to a control signal; clearing a bit assigns the pin to port f. refer to table d-6 . d.2.12 system protection control register sypcr controls system monitor functions, software watchdog clock prescaling, and bus monitor timing. this register can be written once following power-on or reset. swe ?software watchdog enable 0 = software watchdog is disabled. 1 = software watchdog is enabled. swp ?software watchdog prescale this bit controls the value of the software watchdog prescaler. 0 = software watchdog clock is not prescaled. 1 = software watchdog clock is prescaled by 512. the reset value of swp is the complement of the state of the modclk pin during reset. swt[1:0] ?software watchdog timing this field selects the divide ration used to establish software watchdog timeout period. refer to table d-7 . table d-6 port f pin assignments pfpar field port f signal alternate signal pfpa7 pf7 irq7 pfpa6 pf6 irq6 pfpa5 pf5 irq5 pfpa4 pf4 irq4 pfpa3 pf3 irq3 pfpa2 pf2 irq2 pfpa1 pf1 irq1 pfpa0 pf0 modclk sypcr system protection control register $yffa21 15 8 7 6 5 4 3 2 1 0 not used swe swp swt[1:0] hme bme bmt[1:0] reset: 1 modclk 0 0 0 0 0 0 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-13 hme ?halt monitor enable 0 = halt monitor is disabled. 1 = halt monitor is enabled. bme ?bus monitor external enable 0 = disable bus monitor for internal to external bus cycle. 1 = enable bus monitor for internal to external bus cycle. bmt[1:0] ?bus monitor timing this field selects the bus monitor time-out period. refer to table d-8 . d.2.13 periodic interrupt control register picr sets the interrupt level and vector number for the periodic interrupt timer (pit). bits [10:0] can be read or written at any time. bits [15:11] are unimplemented and al- ways read zero. pirql[2:0] ?periodic interrupt request level this field determines the priority of periodic interrupt requests. a value of %000 disables pit interrupts. table d-7 software watchdog timing field swp swt[1:0] watchdog time-out period 000 2 9 ? f sys 001 2 11 ? f sys 010 2 13 ? f sys 011 2 15 ? f sys 100 2 18 ? f sys 101 2 20 ? f sys 110 2 22 ? f sys 111 2 24 ? f sys table d-8 bus monitor time-out period bmt[1:0] bus monitor time-out period 00 64 system clocks 01 32 system clocks 10 16 system clocks 11 8 system clocks picr periodic interrupt control register $yffa22 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 pirql[2:0] piv[7:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-14 user? manual piv[7:0] ?periodic interrupt vector this field specifies the periodic interrupt vector number supplied by the sim when the cpu32 acknowledges an interrupt request. d.2.14 periodic interrupt timer register pitr specifies the prescaling and modulus value for the pit. this register can be read or written at any time. ptp ?periodic timer prescaler control 0 = periodic timer clock is not prescaled. 1 = periodic timer clock is prescaled by 512. pitm[7:0] ?periodic interrupt timing modulus this field determines the periodic interrupt rate. use the following expressions to calculate timer period. when a fast reference frequency is used, the pit period can be calculated as follows: when an externally input clock frequency is used, the pit period can be calculated as follows: d.2.15 software watchdog service register notes: 1. register shown with read value. pitr periodic interrupt timer register $yffa24 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 ptp pitm[7:0] reset: 0 0 0 0 0 0 0 modclk 0 0 0 0 0 0 0 0 swsr software watchdog service register 1 $yffa27 15 8 7 6 5 4 3 2 1 0 not used 0 0 0 0 0 0 0 0 reset: 0 0 0 0 0 0 0 0 pit period 128 () pitm[7:0] () 1 if ptp = 0, 512 if ptp = 1 () 4 () f ref ------------------------------------------------------------------------------------------------------------------------------------ - = pit period pitm[7:0] () 1 if ptp = 0, 512 if ptp = 1 () 4 () f ref --------------------------------------------------------------------------------------------------------------------- = 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-15 to reset the software watchdog: 1. write $55 to swsr. 2. write $aa to swsr. both writes must occur in the order specified before the software watchdog times out, but any number of instructions can occur between the two writes. d.2.16 port c data register portc latches data for chip-select pins configured as discrete outputs. d.2.17 chip-select pin assignment registers the chip-select pin assignment registers configure the chip-select pins for use as dis- crete i/o, an alternate function, or as an 8-bit or 16-bit chip-select. each 2-bit field in cspar[0:1] (except for csbtpa[1:0]) has the possible encoding shown in table d-9 . cspar0 contains seven 2-bit fields that determine the function of corresponding chip- select pins. bits [15:14] are not used. these bits always read zero; writes have no effect. cspar0 bit 1 always reads one; writes to cspar0 bit 1 have no effect. the alternate functions can be enabled by data bus mode selection during reset. table d-10 shows cspar0 pin assignments. notes: 1. does not apply to the csboot field. portc port c data register $yffa41 15 8 7 6 5 4 3 2 1 0 not used 0 pc6 pc5 pc4 pc3 pc2 pc1 pc0 reset: 0 1 1 1 1 1 1 1 cspar0 chip-select pin assignment register 0 $yffa44 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 cs5pa[1:0] cs4pa[1:0] cs3pa[1:0] cs2pa[1:0] cs1pa[1:0] cs0pa[1:0] csbtpa[1:0] reset: 0 0 data2 1 data2 1 data2 1 data1 1 data1 1 data1 1 1 data0 table d-9 pin assignment field encoding csxpa[1:0] description 00 discrete output 1 01 alternate function 1 10 chip-select (8-bit port) 11 chip-select (16-bit port) 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-16 user? manual cspar1 contains five 2-bit fields that determine the functions of corresponding chip- select pins. bits [15:10] are not used. these bits always read zero; writes have no ef- fect. table d-11 shows cspar1 pin assignments, including alternate functions that can be enabled by data bus mode selection during reset. the reset state of data[7:3] determines whether pins controlled by cspar1 are ini- tially configured as high-order address lines or chip-selects. table d-12 shows the correspondence between data[7:3] and the reset configuration of cs[10:6] / addr[23:19]. notes: 1. refer to table d-12 for cspar1 reset state information. table d-10 cspar0 pin assignments cspar0 field chip-select signal alternate signal discrete output cs5pa[1:0] cs5 fc2 pc2 cs4pa[1:0] cs4 fc1 pc1 cs3pa[1:0] cs3 fc0 pc0 cs2pa[1:0] cs2 bgack cs1pa[1:0] cs1 bg cs0pa[1:0] cs0 br csbtpa[1:0] csboot cspar1 chip-select pin assignment register 1 $yffa46 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 cs10pa[1:0] cs9pa[1:0] cs8pa[1:0] cs7pa[1:0] cs6pa[1:0] reset: 0 0 0 0 0 0 data7 1 1 data [7:6] 1 1 data [7:5] 1 1 data [7:4] 1 1 data [7:3] 1 1 table d-11 cspar1 pin assignments cspar1 field chip-select signal alternate signal discrete output cs10pa[1:0] cs10 addr23 eclk cs9pa[1:0] cs9 addr22 pc6 cs8pa[1:0] cs8 addr21 pc5 cs7pa[1:0] cs7 addr20 pc4 cs6pa[1:0] cs6 addr19 pc3 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-17 d.2.18 chip-select base address register boot rom d.2.19 chip-select base address registers each chip-select pin has an associated base address register. a base address is the lowest address in the block of addresses enabled by a chip select. csbarbt contains the base address for selection of a bootstrap memory device. bit and field definitions for csbarbt and csbar[0:10] are the same, but reset block sizes differ. addr[23:11] ?base address this field sets the starting address of a particular chip-select? address space. the address compare logic uses only the most significant bits to match an address within a block. the value of the base address must be an integer multiple of the block size. base address register diagrams show how base register bits correspond to address lines. blksz[2:0] ?block size field this field determines the size of the block that is enabled by the chip-select. table d-13 shows bit encoding for the base address registers block size field. table d-12 reset pin function of cs[10:6] data bus pins at reset chip-select/address bus pin function data7 data6 data5 data4 data3 cs10 / addr23 cs9 / addr22 cs8 / addr21 cs7 / addr20 cs8 / addr19 11111 cs10 cs9 cs8 cs7 cs6 1111 0 cs10 cs9 cs8 cs7 addr19 111 0 x cs10 cs9 cs8 addr20 addr19 11 0 x x cs10 cs9 addr21 addr20 addr19 1 0 x x x cs10 addr22 addr21 addr20 addr19 0xxxx addr23 addr22 addr21 addr20 addr19 csbarbt chip-select base address register boot rom $yffa48 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 addr 23 addr 22 addr 21 addr 20 addr 19 addr 18 addr 17 addr 16 addr 15 addr 14 addr 13 addr 12 addr 11 blksz[2:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 csbar[0:10] chip-select base address registers $yffa4c?yffa74 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 addr 23 addr 22 addr 21 addr 20 addr 19 addr 18 addr 17 addr 16 addr 15 addr 14 addr 13 addr 12 addr 11 blksz[2:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-18 user? manual d.2.20 chip-select option register boot rom d.2.21 chip-select option registers csorbt and csor[0:10] contain parameters that support bootstrap operations from peripheral memory devices. bit and field definitions for csorbt and csor[0:10] are the same. mode ?asynchronous/synchronous mode 0 = asynchronous mode selected. 1 = synchronous mode selected. in asynchronous mode, chip-select assertion is synchronized with as and ds . in synchronous mode, the dsack field is not used because a bus cycle is only per- formed as a synchronous operation. when a match condition occurs on a chip-select programmed for synchronous operation, the chip-select signals the ebi that an e- clock cycle is pending. refer to 5.3 system clock for more information on eclk. byte[1:0] ?upper/lower byte option this field is used only when the chip-select 16-bit port option is selected in the pin as- signment register. table d-14 shows upper/lower byte options. table d-13 block size field bit encoding blksz[2:0] block size address lines compared 000 2 kbytes addr[23:11] 001 8 kbytes addr[23:13] 010 16 kbytes addr[23:14] 011 64 kbytes addr[23:16] 100 128 kbytes addr[23:17] 101 256 kbytes addr[23:18] 110 512 kbytes addr[23:19] 111 1 mbyte addr[23:20] csorbt chip-select option register boot rom $yffa4a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mode byte[1:0] r/ w [1:0] strb dsack[3:0] space[1:0] ipl[2:0] avec reset: 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 csor[0:10] chip-select option registers $yffa4e?ffa76 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mode byte[1:0] r/ w [1:0] strb dsack[3:0] space[1:0] ipl[2:0] avec reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 18 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-19 r/w [1:0]?read/write this field causes a chip-select to be asserted only for a read, only for a write, or for both read and write. table d-15 shows the options. strb ?address strobe/data strobe this bit controls the timing for assertion of a chip-select in asynchronous mode. se- lecting address strobe causes the chip-select to be asserted synchronized with address strobe. selecting data strobe causes the chip-select to be asserted synchro- nized with data strobe. 0 = address strobe 1 = data strobe dsack[3:0] ?data strobe acknowledge this field specifies the source of dsack in asynchronous mode. it also allows the user to adjust bus timing with internal dsack generation by controlling the number of wait states that are inserted to optimize bus speed in a particular application. table d-16 shows the dsack[3:0] field encoding. the fast termination encoding (%1110) effec- tively corresponds to ? wait states. table d-14 byte field bit encoding byte[1:0] description 00 disable 01 lower byte 10 upper byte 11 both bytes table d-15 read/write field bit encoding r/w [1:0] description 00 disable 01 read only 10 write only 11 read/write 336376umbook page 19 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-20 user? manual space[1:0] ?address space select use this option field to select an address space for the chip-select logic. the cpu32 normally operates in supervisor or user space, but interrupt acknowledge cycles must take place in cpu space. table d-17 shows address space bit encodings. ipl[2:0] ?interrupt priority level when space[1:0] is set for cpu space (%00), chip-select logic can be used for inter- rupt acknowledge. during an interrupt acknowledge cycle, the priority level on address lines addr[3:1] is compared to the value in ipl[2:0]. if the values are the same, a chip-select can be asserted, provided other option register conditions are met. table d-18 shows ipl[2:0] field encoding. table d-16 dsack field encoding dsack [3:0] clock cycles required per access wait states inserted per access 0000 3 0 0001 4 1 0010 5 2 0011 6 3 0100 7 4 0101 8 5 0110 9 6 0111 10 7 1000 11 8 1001 12 9 1010 13 10 1011 14 11 1100 15 12 1101 16 13 1110 2 fast termination 1111 external dsack table d-17 address space bit encodings space[1:0] address space 00 cpu space 01 user space 10 supervisor space 11 supervisor/user space table d-18 interrupt priority level field encoding ipl[2:0] interrupt priority level 000 any level 001 1 010 2 011 3 100 4 101 5 110 6 111 7 336376umbook page 20 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-21 this field only affects the response of chip-selects and does not affect interrupt recognition by the cpu32. avec ?autovector enable this field selects one of two methods of acquiring an interrupt vector during an interrupt acknowledge cycle. it is not usually used with a chip-select pin. 0 = external interrupt vector enabled 1 = autovector enabled if the chip select is configured to trigger on an interrupt acknowledge cycle (space[1:0] = %00) and the avec field is set to one, the chip-select automatically generates avec in response to the interrupt acknowledge cycle. otherwise, the vec- tor must be supplied by the requesting device. d.2.22 master shift registers tstmsra ?master shift register a $yffa30 used for factory test only. tstmsrb ?master shift register b $yffa32 used for factory test only. d.2.23 test module shift count register tstsc ?test module shift count $yffa34 used for factory test only. d.2.24 test module repetition count register tstrc ?test module repetition count $yffa36 used for factory test only. d.2.25 test submodule control register creg ?test submodule control register $yffa38 used for factory test only. d.2.26 distributed register dreg ?distributed register $yffa3a used for factory test only. 336376umbook page 21 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-22 user? manual d.3 standby ram module table d-19 shows the sram address map. sram control registers are accessible at the supervisor privilege level only. d.3.1 ram module configuration register stop ?low-power stop mode enable 0 = sram operates normally. 1 = sram enters low-power stop mode. this bit controls whether sram operates normally or enters low-power stop mode. in low-power stop mode, the array retains its contents, but cannot be read or written. rlck ?ram base address lock 0 = sram base address registers can be written. 1 = sram base address registers are locked. rlck defaults to zero on reset; it can be written once to one rasp[1:0] ?ram array space the rasp field limits access to the sram array to one of four cpu32 address spaces. refer to table d-20 . notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. table d-19 sram address map address 1 15 0 $yffb40 ram module configuration register (rammcr) $yffb42 ram test register (ramtst) $yffb44 ram array base address register high (rambah) $yffb46 ram array base address register low (rambal) rammcr ram module configuration register $yffb40 15 11 9 8 0 stop 0 0 0 rlck 0 rasp[1:0] not used reset: 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 table d-20 rasp encoding rasp[1:0] space 00 unrestricted program and data 01 unrestricted program 10 supervisor program and data 11 supervisor program 336376umbook page 22 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-23 d.3.2 ram test register ramtst ram test register $yffb42 used for factory test only. d.3.3 array base address register high d.3.4 array base address register low rambah and rambal specify the sram array base address in the system memory map. they can only be written while the sram is in low-power stop mode (stop = 1, the default out of reset) and the base address lock is disabled (rlck = 0, the default out of reset). this prevents accidental remapping of the array. rambah array base address register high $yffb44 15 8 7 6 5 4 3 2 1 0 not used addr 23 addr 22 addr 21 addr 20 addr 19 addr 18 addr 17 addr 16 reset: 0 0 0 0 0 0 0 0 rambal array base address register low $yffb46 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 addr 15 addr 14 addr 13 addr 12 0 0 0 0 0 0 0 0 0 0 0 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 23 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-24 user? manual d.4 masked rom module the mrm is used only in the mc68376. table d-21 shows the mrm address map. mrm control registers are accessible in supervisor mode only. the reset states shown for the mrm registers are for the generic (blank rom) ver- sions of the device. several mrm register bit fields can be user-specified on a custom- masked rom device. contact a motorola sales representative for information on or- dering a custom rom device. d.4.1 masked rom module configuration register stop ?low-power stop mode enable the reset state of the stop bit is the complement of data14 state during reset. the rom array base address cannot be changed unless the stop bit is set. 0 = rom array operates normally. 1 = rom array operates in low-power stop mode. note unless data14 is pulled down during reset, the mrm will be en- abled. on generic mc68376 devices (blank rom), the mrm is en- abled at address $ff0000 (which is outside of the 1 mbyte address range of csboot . on these devices, the mrm should be disabled (since it is blank) by setting the stop bit during system initialization. table d-21 mrm address map address 15 0 $yff820 masked rom module configuration register (mrmcr) $yff822 not implemented $yff824 rom array base address high register (rombah) $yff826 rom array base address low register (rombal) $yff828 signature high register (sighi) $yff82a signature low register (siglo) $yff82c not implemented $yff82e not implemented $yff830 rom bootstrap word 0 (rombs0) $yff832 rom bootstrap word 1 (rombs1) $yff834 rom bootstrap word 2 (rombs2) $yff836 rom bootstrap word 3 (rombs3) $yff838 not implemented $yff83a not implemented $yff83c not implemented $yff83e not implemented mrmcr masked rom module configuration register $yff820 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop 0 0 boot lock emul aspc[1:0] wait[1:0] 0 0 0 0 0 0 reset: data14 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0 336376umbook page 24 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-25 boot ?boot rom control reset state of boot is specified at mask time. bootstrap operation is overridden if stop = 1 at reset. this is a read-only bit. 0 = rom responds to bootstrap word locations during reset vector fetch. 1 = rom does not respond to bootstrap word locations during reset vector fetch. lock ?lock registers the reset state of lock is specified at mask time. if the reset state of the lock is zero, it can be set once after reset to allow protection of the registers after initialization. once the lock bit is set, it cannot be cleared again until after a reset. lock protects the aspc and wait fields, as well as the rombal and rombah registers. aspc, rombal and rombah are also protected by the stop bit. 0 = write lock disabled. protected registers and fields can be written. 1 = write lock enabled. protected registers and fields cannot be written. emul ?emulation mode control 0 = normal rom operation the mc68376 does not support emulation mode, therefore, this bit reads zero. writes have no effect. aspc[1:0] ?rom array space aspc can be written only if lock = 0 and stop = 1. aspc1 places the rom array in either supervisor or unrestricted space. aspc0 determines if the array resides in program space only or with program and data space. the reset state of aspc[1:0] is specified at mask time. table d-22 shows aspc[1:0] encoding. wait[1:0] ?wait states wait[1:0] specifies the number of wait states inserted by the mrm during rom array accesses. the reset state of wait[1:0] is specified at mask time. wait[1:0] can be written only if lock = 0 and stop = 1. table d-23 shows wait[1:0] encoding. table d-22 rom array space field aspc[1:0] state specified 00 unrestricted program and data 01 unrestricted program 10 supervisor program and data 11 supervisor program table d-23 wait states field wait[1:0] cycles per transfer 00 3 01 4 10 5 11 2 336376umbook page 25 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-26 user? manual d.4.2 rom array base address register high d.4.3 rom array base address register low rombah and rombal specify rom array base address. the reset state of these registers is specified at mask time. they can only be written when stop = 1 and lock = 0. this prevents accidental remapping of the array. because the 8-kbyte rom array in the mc68376 must be mapped to an 8-kbyte boundary, rombal bits [12:0] always contains $0000. rombah addr[15:8] read zero. d.4.4 rom signature high register d.4.5 rom signature low register rsighi and rsiglo specify a rom signature pattern. a user-written signature iden- tification algorithm allows identification of the rom array content. the signature is specified at mask time and cannot be changed. rombah rom array base address register high $yff824 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 addr 23 addr 22 addr 21 addr 20 addr 19 addr 18 addr 17 addr 16 reset: 1 1 1 1 1 1 1 1 rombal rom array base address register low $yff826 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 addr 15 addr 14 addr 13 0 0 0 0 0 0 0 0 0 0 0 0 0 reset: 0 0 0 rsighi rom signature high register $yff828 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 not used rsp18 rsp17 rsp16 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 rsiglo rom signature low register $yff82a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rsp15 rsp14 rsp13 rsp12 rsp11 rsp10 rsp9 rsp8 rsp7 rsp6 rsp5 rsp4 rsp3 rsp2 rsp1 rsp0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 26 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-27 d.4.6 rom bootstrap words rombs0 ? rom bootstrap word 0 $yff830 rombs1 ? rom bootstrap word 1 $yff832 rombs2 ? rom bootstrap word 2 $yff834 rombs3 ? rom bootstrap word 3 $yff836 typically, cpu32 reset vectors reside in non-volatile memory and are only fetched when the cpu32 comes out of reset. these four words can be used as reset vectors with the contents specified at mask time. the content of these words cannot be changed. on generic (blank rom) mc68376 devices, rombs[0:3] are masked to $0000. when the rom on the mc68376 is masked with customer specific code, rombs[0:3] respond to system addresses $000000 to $000006 only during the reset vector fetch if boot = 0. 336376umbook page 27 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-28 user? manual d.5 qadc module table d-24 shows the qadc address map. the column labeled ?ccess?indicates the privilege level at which the cpu32 must be operating to access the register. a des- ignation of ??indicates that supervisor mode is required. a designation of ?/u indicates that the register can be programmed for either supervisor mode access or unrestricted access. d.5.1 qadc module configuration register stop ?low-power stop mode enable when the stop bit is set, the clock signal to the qadc is disabled, effectively turning off the analog circuitry. 0 = enable qadc clock. 1 = disable qadc clock. notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in simcr. table d-24 qadc address map access address 1 15 8 7 0 s $yff200 module configuration register (qadcmcr) s $yff202 test register (qadctest) s $yff204 interrupt register (qadcint) s/u $yff206 port a data (portqa) port b data (portqb) s/u $yff208 port data direction register (ddrqa) s/u $yff20a control register 0 (qacr0) s/u $yff20c control register 1 (qacr1) s/u $yff20e control register 2 (qacr2) s/u $yff210 status register (qasr) $yff212 ?$yff22e reserved s/u $yff230 ?$yff27e conversion command word (ccw) table $yff280 ?$yff2ae reserved s/u $yff2b0 ?$yff2fe result word table right justified, unsigned result register (rjurr) $yff300 ?$yff32e reserved s/u $yff330 ?$yff37e result word table left justified, signed result register (ljsrr) $yff380 ?$yff3ae reserved s/u $yff3b0 ?$yff3fe result word table left justified, unsigned result register (ljurr) qadcmcr module configuration register $yff200 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop frz not used supv not used iarb[3:0] reset: 0 0 1 0 0 0 0 336376umbook page 28 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-29 frz ?freeze assertion response the frz bit determines whether or not the qadc responds to assertion of the imb freeze signal. 0 = qadc ignores the imb freeze signal. 1 = qadc finishes any current conversion, then freezes. supv ?supervisor/unrestricted data space the supv bit designates the assignable space as supervisor or unrestricted. 0 = only the module configuration register, test register, and interrupt register are designated as supervisor-only data space. access to all other locations is unrestricted. 1 = all qadc registers and tables are designated as supervisor-only data space. iarb[3:0] ?interrupt arbitration id the iarb field is used to arbitrate between simultaneous interrupt requests of the same priority. each module that can generate interrupt requests must be assigned a unique, non-zero iarb field value. d.5.2 qadc test register qadctest ? qadc test register $yff202 used for factory test only. d.5.3 qadc interrupt register irlq1[2:0] ?queue 1 interrupt level when queue 1 generates an interrupt request, irlq1[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the qadc compares irlq1[2:0] to a mask value supplied by the cpu32 to determine whether to respond. irlq1[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). irlq2[2:0] ?queue 2 interrupt level when queue 2 generates an interrupt request, irlq2[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the qadc compares irlq2[2:0] to a mask value supplied by the cpu32 to determine whether to respond. irlq2[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). notes: 1. bits 1 and 0 are supplied by the qadc. qadcint qadc interrupt register $yff204 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rsvd irlq1[2:0] rsvd irlq2[2:0] ivb[7:2] ivb[1:0] 1 reset: 0 0 0 0 0 0 0 0 0 0 1 1 1 1 336376umbook page 29 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-30 user? manual ivb[7:0] ?interrupt vector base only the upper six bits of ivb[7:0] can be initialized. during interrupt arbitration, the vector provided by the qadc is made up of ivb[7:2], plus two low-order bits that identify one of the four qadc interrupt sources. once ivb is written, the two low-order bits always read as zeros. d.5.4 port a/b data register qadc ports a and b are accessed through two 8-bit port data registers (portqa and portqb). port a pins are referred to as pqa[7:0] when used as an 8-bit input/output port. port a can also be used for analog inputs (an[59:52]), external trigger inputs (etrig[2:1]), and external multiplexer address outputs (ma[2:0]). port b pins are referred to as pqb[7:0] when used as an 8-bit input only port. port b can also be used for non-multiplexed (an[51:48])/an[3:0]) and multiplexed (anz, any, anx, anw) analog inputs. d.5.5 port data direction register bits in this register control the direction of the port qa pin drivers when pins are con- figured for i/o. setting a bit configures the corresponding pin as an output; clearing a bit configures the corresponding pin as an input. this register can be read or written at any time. portqa ? port qa data register $yff206 portqb ? port qb data register $yff207 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 pqa7 pqa6 pqa5 pqa4 pqa3 pqa2 pqa1 pqa0 pqb7 pqb6 pqb5 pqb4 pqb3 pqb2 pqb1 pqb0 reset: u u u u u u u uuuuuuuuu analog channel: an59 an58 an57 an56 an55 an54 an53 an52 an51 an50 an49 an48 an3 an2 an1 an0 external trigger inputs: etrig2 etrig1 multiplexed address outputs: ma2 ma1 ma0 multiplexed analog inputs: anz any anx anw ddrqa ? port qa data direction register $yff208 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ddqa7 ddqa6 ddqa5 ddqa4 ddqa3 ddqa2 ddqa1 ddqa0 reserved reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 30 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-31 d.5.6 qadc control registers mux ?externally multiplexed mode the mux bit configures the qadc for externally multiplexed mode, which affects the interpretation of the channel numbers and forces the ma[2:0] pins to be outputs. 0 = internally multiplexed, 16 possible channels. 1 = externally multiplexed, 44 possible channels. psh[4:0] ?prescaler clock high time the psh field selects the qclk high time in the prescaler. to keep qclk within the specified range, psh[4:0] must be programmed to guarantee the minimum acceptable time for parameter t psh (refer to table a-13 for more information). the following equation relates t psh to psh[4:0]: psa ?prescaler add a tick the psa bit modifies the qclk duty cycle by adding one system clock tick to the high time and subtracting one system clock tick from the low time. 0 = qclk high and low times are not modified. 1 = add one system clock tick to the high time of qclk and subtract one system clock tick from the low time. psl[2:0] ?prescaler clock low time the psl field selects the qclk low time in the prescaler. to keep qclk within the specified range, psl[2:0] must be programmed to guarantee the minimum acceptable time for parameter t psl (refer to table a-13 for more information). the following equation relates t psl to psl[2:0]: qacr0 ? qadc control register 0 $yff20a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mux reserved psh[4:0] psa psl[2:0] reset: 0 0 0 0 1 1 0 0 1 1 t psh psh[4:0] 1 + f sys --------------------------------- = t psl psl[2:0] 1 + f sys -------------------------------- = 336376umbook page 31 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-32 user? manual cie1 ?queue 1 completion interrupt enable cie1 enables completion interrupts for queue 1. the interrupt request is generated when the conversion is complete for the last ccw in queue 1. 0 = queue 1 completion interrupts disabled. 1 = generate an interrupt request after completing the last ccw in queue 1. pie1 ?queue 1 pause interrupt enable pie1 enables pause interrupts for queue 1. the interrupt request is generated when the conversion is complete for a ccw that has the pause bit set. 0 = queue 1 pause interrupts disabled. 1 = generate an interrupt request after completing a ccw in queue 1 which has the pause bit set. sse1 ?queue 1 single-scan enable sse1 enables a single-scan of queue 1 after a trigger event occurs. the sse1 bit may be set to a one during the same write cycle that sets the mq1[2:0] bits for the single- scan queue operating mode. the single-scan enable bit can be written as a one or a zero, but is always read as a zero. the sse1 bit allows a trigger event to initiate queue execution for any single-scan op- eration on queue 1. the qadc clears sse1 when the single-scan is complete. mq1[2:0] ?queue 1 operating mode the mq1 field selects the queue operating mode for queue 1. table d-25 shows the different queue 1 operating modes. qacr1 ? control register 1 $yff20c 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cie1 pie1 sse1 not used mq1[2:0] reserved reset: 0 0 0 0 0 0 table d-25 queue 1 operating modes mq1[2:0] queue 1 operating mode 000 disabled mode, conversions do not occur 001 software triggered single-scan mode (started with sse1) 010 external trigger rising edge single-scan mode (on etrig1 pin) 011 external trigger falling edge single-scan mode (on etrig1 pin) 100 reserved mode, conversions do not occur 101 software triggered continuous-scan mode (started with sse1) 110 external trigger rising edge continuous-scan mode (on etrig1 pin) 111 external trigger falling edge continuous-scan mode (on etrig1 pin) 336376umbook page 32 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-33 cie2 ?queue 2 completion interrupt enable cie2 enables completion interrupts for queue 2. the interrupt request is generated when the conversion is complete for the last ccw in queue 2. 0 = queue 2 completion interrupts disabled. 1 = generate an interrupt request after completing the last ccw in queue 2. pie2 ?queue 2 pause interrupt enable pie2 enables pause interrupts for queue 2. the interrupt request is generated when the conversion is complete for a ccw that has the pause bit set. 0 = queue 2 pause interrupts disabled. 1 = generate an interrupt request after completing a ccw in queue 2 which has the pause bit set. sse2 ?queue 2 single-scan enable bit sse2 enables a single-scan of queue 2 after a trigger event occurs. the sse2 bit may be set to a one during the same write cycle that sets the mq2[4:0] bits for the single- scan queue operating mode. the single-scan enable bit can be written as a one or a zero, but is always read as a zero. the sse2 bit allows a trigger event to initiate queue execution for any single-scan op- eration on queue 2. the qadc clears sse2 when the single-scan is complete. mq2[4:0] ?queue 2 operating mode the mq2 field selects the queue operating mode for queue 2. table d-26 shows the bits in the mq2 field which enable different queue 2 operating modes. qacr2 ? control register 2 $yff20e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cie2 pie2 sse2 mq2[4:0] res not used bq2[5:0] reset: 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 336376umbook page 33 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-34 user? manual res ?queue 2 resume res selects the resumption point after queue 2 is suspended by queue 1. if res is changed during execution of queue 2, the change is not recognized until an end-of- queue condition is reached, or the queue operating mode of queue 2 is changed. 0 = after suspension, begin execution with the first ccw in queue 2 or the current subqueue. 1 = after suspension, begin execution with the aborted ccw in queue 2. table d-26 queue 2 operating modes mq2[4:0] queue 2 operating mode 00000 disabled mode, conversions do not occur 00001 software triggered single-scan mode (started with sse2) 00010 external trigger rising edge single-scan mode (on etrig2 pin) 00011 external trigger falling edge single-scan mode (on etrig2 pin) 00100 interval timer single-scan mode: interval = qclk period x 2 7 00101 interval timer single-scan mode: interval = qclk period x 2 8 00110 interval timer single-scan mode: interval = qclk period x 2 9 00111 interval timer single-scan mode: interval = qclk period x 2 10 01000 interval timer single-scan mode: interval = qclk period x 2 11 01001 interval timer single-scan mode: interval = qclk period x 2 12 01010 interval timer single-scan mode: interval = qclk period x 2 13 01011 interval timer single-scan mode: interval = qclk period x 2 14 01100 interval timer single-scan mode: interval = qclk period x 2 15 01101 interval timer single-scan mode: interval = qclk period x 2 16 01110 interval timer single-scan mode: interval = qclk period x 2 17 01111 reserved mode 10000 reserved mode 10001 software triggered continuous-scan mode (started with sse2) 10010 external trigger rising edge continuous-scan mode (on etrig2 pin) 10011 external trigger falling edge continuous-scan mode (on etrig2 pin) 10100 periodic timer continuous-scan mode: period = qclk period x 2 7 10101 periodic timer continuous-scan mode: period = qclk period x 2 8 10110 periodic timer continuous-scan mode: period = qclk period x 2 9 10111 periodic timer continuous-scan mode: period = qclk period x 2 10 11000 periodic timer continuous-scan mode: period = qclk period x 2 11 11001 periodic timer continuous-scan mode: period = qclk period x 2 12 11010 periodic timer continuous-scan mode: period = qclk period x 2 13 11011 periodic timer continuous-scan mode: period = qclk period x 2 14 11100 periodic timer continuous-scan mode: period = qclk period x 2 15 11101 periodic timer continuous-scan mode: period = qclk period x 2 16 11110 periodic timer continuous-scan mode: period = qclk period x 2 17 11111 reserved mode 336376umbook page 34 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-35 bq2[5:0] ?beginning of queue 2 the bq2 field indicates the location in the ccw table where queue 2 begins. the bq2 field also indicates the end of queue 1 and thus creates an end-of-queue condition for queue 1. d.5.7 qadc status register cf1 ?queue 1 completion flag cf1 indicates that a queue 1 scan has been completed. cf1 is set by the qadc when the conversion is complete for the last ccw in queue 1, and the result is stored in the result table. 0 = queue 1 scan is not complete. 1 = queue 1 scan is complete. pf1 ?queue 1 pause flag pf1 indicates that a queue 1 scan has reached a pause. pf1 is set by the qadc when the current queue 1 ccw has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. 0 = queue 1 has not reached a pause. 1 = queue 1 has reached a pause. cf2 ?queue 2 completion flag cf2 indicates that a queue 2 scan has been completed. cf2 is set by the qadc when the conversion is complete for the last ccw in queue 2, and the result is stored in the result table. 0 = queue 2 scan is not complete. 1 = queue 2 scan is complete. pf2 ?queue 2 pause flag pf2 indicates that a queue 2 scan has reached a pause. pf2 is set by the qadc when the current queue 2 ccw has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. 0 = queue 2 has not reached a pause. 1 = queue 2 has reached a pause. tor1 ?queue 1 trigger overrun tor1 indicates that an unexpected queue 1 trigger event has occurred. tor1 can be set only while queue 1 is active. a trigger event generated by a transition on etrig1 may be recorded as a trigger overrun. tor1 can only be set when using an external trigger mode. tor1 cannot oc- cur when the software initiated single-scan mode or the software initiated continuous- scan mode is selected. qasr ? status register $yfff210 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cf1 pf1 cf2 pf2 tor1 tor2 qs[3:0] cwp[5:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 35 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-36 user? manual 0 = no unexpected queue 1 trigger events have occurred. 1 = at least one unexpected queue 1 trigger event has occurred. tor2 ?queue 2 trigger overrun tor2 indicates that an unexpected queue 2 trigger event has occurred. tor2 can be set when queue 2 is in the active, suspended, and trigger pending states. a trigger event generated by a transition on etrig2 or by the periodic/interval timer may be recorded as a trigger overrun. tor2 can only be set when using an external trigger mode or a periodic/interval timer mode. trigger overruns cannot occur when the software initiated single-scan mode and the software initiated continuous-scan mode are selected. 0 = no unexpected queue 2 trigger events have occurred. 1 = at least one unexpected queue 2 trigger event has occurred. qs[3:0] ?queue status this 4-bit read-only field indicates the current condition of queue 1 and queue 2. qs[3:2] are associated with queue 1, and qs[1:0] are associated with queue 2. since the queue priority scheme interlinks the operation of queue 1 and queue 2, the status bits should be considered as one 4-bit field. table d-27 shows the bit encodings of the qs field. cwp[5:0] ?command word pointer cwp indicates which ccw is executing at present, or was last completed. the cwp is a read-only field; writes to it have no effect. the cwp allows software to monitor the progress of the qadc scan sequence. the cwp field is a ccw word pointer with a valid range of 0 to 39. table d-27 queue status qs[3:0] description 0000 queue 1 idle, queue 2 idle 0001 queue 1 idle, queue 2 paused 0010 queue 1 idle, queue 2 active 0011 queue 1 idle, queue 2 trigger pending 0100 queue 1 paused, queue 2 idle 0101 queue 1 paused, queue 2 paused 0110 queue 1 paused, queue 2 active 0111 queue 1 paused, queue 2 trigger pending 1000 queue 1 active, queue 2 idle 1001 queue 1 active, queue 2 paused 1010 queue 1 active, queue 2 suspended 1011 queue 1 active, queue 2 trigger pending 1100 reserved 1101 reserved 1110 reserved 1111 reserved 336376umbook page 36 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-37 d.5.8 conversion command word table p ?pause the pause bit allows the creation of sub-queues within queue 1 and queue 2. the qadc performs the conversion specified by the ccw with the pause bit set, and then the queue enters the pause state. another trigger event causes execution to continue from the pause to the next ccw. 0 = do not enter the pause state after execution of the current ccw. 1 = enter the pause state after execution of the current ccw. byp ?sample amplifier bypass setting byp enables the amplifier bypass mode for a conversion, and subsequently changes the timing. refer to 8.11.1.1 amplifier bypass mode conversion timing for more information. 0 = amplifier bypass mode disabled. 1 = amplifier bypass mode enabled. ist[1:0] ?input sample time the ist field specifies the length of the sample window. longer sample times permit more accurate a/d conversions of signals with higher source impedances. table d-28 shows the bit encoding of the ist field. chan[5:0] ?channel number the chan field selects the input channel number corresponding to the analog input pin to be sampled and converted. the analog input pin channel number assignments and the pin definitions vary depending on whether the qadc is operating in multi- plexed or non-multiplexed mode. the queue scan mechanism sees no distinction be- tween an internally or externally multiplexed analog input. chan specifies a reserved channel number (channels 32 to 47) or an invalid channel number (channels 4 to 31 in non-multiplexed mode), the low reference level (v rl ) is converted. programming the channel field to channel 63 indicates the end of the queue. channels 60 to 62 are special internal channels. when one of these channels is selected, the sample amplifier is not used. the value of v rl , v rh , or v dda /2 is placed directly onto the converter. programming the input sample time to any value other than two for one of the internal channels has no benefit except to lengthen the overall conversion time. ccw[0:27] ? conversion command word table $yff230?yff27e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 not used p byp ist[1:0] chan[5:0] reset: u u u u u u u u u u table d-28 input sample times ist[1:0] input sample times 00 2 qclk periods 01 4 qclk periods 10 8 qclk periods 11 16 qclk periods 336376umbook page 37 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-38 user? manual table d-29 shows the channel number assignments for the non-multiplexed mode. table d-30 shows the channel number assignments for the multiplexed mode. table d-29 non-multiplexed channel assignments and pin designations non-multiplexed input pins channel number in chan[5:0] port pin name analog pin name other functions pin type binary decimal pqb0 pqb1 pqb2 pqb3 an0 an1 an2 an3 input input input input 000000 000001 000010 000011 0 1 2 3 pqb4 pqb5 an48 an49 invalid reserved input input 000100 to 011111 10xxxx 110000 110001 4 to 31 32 to 47 48 49 pqb6 pqb7 pqa0 pqa1 an50 an51 an52 an53 input input input/output input/output 110010 110011 110100 110101 50 51 52 53 pqa2 pqa3 pqa4 pqa5 an54 an55 an56 an57 etrig1 etrig2 input/output input/output input/output input/output 110110 110111 111000 111001 54 55 56 57 pqa6 pqa7 an58 an59 v rl v rh input/output input/output input input 111010 111011 111100 111101 58 59 60 61 v dda /2 end of queue code 111110 111111 62 63 table d-30 multiplexed channel assignments and pin designations multiplexed input pins channel number in chan[5:0] port pin name analog pin name other functions pin type binary decimal pqb0 pqb1 pqb2 pqb3 anw anx any anz input input input input 00xxx0 00xxx1 01xxx0 01xxx1 0 to 14 even 1 to 15 odd 16 to 30 even 17 to 31 odd pqb4 pqb5 pqb6 an48 an49 an50 reserved input input input 10xxxx 110000 110001 110010 32 to 47 48 49 50 pqb7 pqa0 pqa1 pqa2 an51 ma0 ma1 ma2 input input/output input/output input/output 110011 110100 110101 110110 51 52 53 54 pqa3 pqa4 pqa5 pqa6 an55 an56 an57 an58 etrig1 etrig2 input/output input/output input/output input/output 110111 111000 111001 111010 55 56 57 58 pqa7 an59 v rl v rh v dda /2 input/output input input 111011 111100 111101 111110 59 60 61 62 end of queue code 111111 63 336376umbook page 38 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-39 d.5.9 result word table the result word table is a 40-word long, 10-bit wide ram. an entry is written by the qadc after completing an analog conversion specified by the corresponding ccw table entry. the result word table can be read or written, but is only read in normal operation to obtain analog conversions results from the qadc. unimplemented bits are read as zeros, and writes to them do not have any effect. the conversion result is unsigned, right justified data stored in bits [9:0]. bits [15:10] return zero when read. the conversion result is signed, left justified data stored in bits [15:6], with the msb inverted to form a sign bit. bits [5:0] return zero when read. the conversion result is unsigned, left justified data stored in bits [15:6]. bits [5:0] re- turn zero when read. notes: 1. s = sign bit. rjurr[0:27] ? right justified, unsigned result register $yff2b0?yff2fe 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 not used result ljsrr[0:27] ? left justified, signed result register $yff330?yff37e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 s 1 result not used ljurr[0:27] ? left justified, unsigned result register $yff3b0?yff3fe 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 result not used 336376umbook page 39 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-40 user? manual d.6 queued serial module table d-31 shows the qsm address map. the column labeled ?ccess?indicates the privilege level at which the cpu32 must be operating to access the register. a designation of ??indicates that supervisor mode is required. a designation of ?/u indicates that the register can be programmed for either supervisor mode access or unrestricted access. d.6.1 qsm configuration register qsmcr bits enable stop and freeze modes, and determine the arbitration priority of qsm interrupt requests. notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. table d-31 qsm address map access address 1 15 8 7 0 s $yffc00 qsm module configuration register (qsmcr) s $yffc02 qsm test register (qtest) s $yffc04 qsm interrupt level register (qilr) qsm interrupt vector register (qivr) s/u $yffc06 not used s/u $yffc08 sci control 0 register (sccr0) s/u $yffc0a sci control 1 register (sccr1) s/u $yffc0c sci status register (scsr) s/u $yffc0e sci data register (scdr) s/u $yffc10 not used s/u $yffc12 not used s/u $yffc14 not used pqs data register (portqs) s/u $yffc16 pqs pin assignment register (pqspar) pqs data direction register (ddrqs) s/u $yffc18 spi control register 0 (spcr0) s/u $yffc1a spi control register 1 (spcr1) s/u $yffc1c spi control register 2 (spcr2) s/u $yffc1e spi control register 3 (spcr3) spi status register (spsr) s/u $yffc20 ? $yffcff not used s/u $yffd00 ? $yffd1f receive ram (rr[0:f]) s/u $yffd20 ? $yffd3f transmit ram (tr[0:f]) s/u $yffd40 ? $yffd4f command ram (cr[0:f]) qsmcr qsm configuration register $yffc00 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop frz1 frz0 0 0 0 0 0 supv 0 0 0 iarb[3:0] reset: 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 336376umbook page 40 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-41 stop ?low-power stop mode enable 0 = qsm clock operates normally. 1 = qsm clock is stopped. when stop is set, the qsm enters low-power stop mode. the system clock input to the module is disabled. while stop is set, only qsmcr reads are guaranteed to be valid, but writes to the qspi ram and other qsm registers are guaranteed valid. the sci receiver and transmitter must be disabled before stop is set. to stop the qspi, set the halt bit in spcr3, wait until the halta flag is set, then set stop. frz1?freeze assertion response frz1 determines what action is taken by the qspi when the imb freeze signal is asserted. 0 = ignore the imb freeze signal. 1 = halt the qspi on a transfer boundary. frz0 ?not implemented bits [12:8] ?not implemented supv ?supervisor/unrestricted data space the supv bit places the qsm registers in either supervisor or user data space. 0 = registers with access controlled by the supv bit are accessible in either supervisor or user mode. 1 = registers with access controlled by the supv bit are restricted to supervisor access only. bits [6:4] ?not implemented iarb[3:0] ?interrupt arbitration id the iarb field is used to arbitrate between simultaneous interrupt requests of the same priority. each module that can generate interrupt requests must be assigned a unique, non-zero iarb field value. d.6.2 qsm test register qtest qsm test register $yffc02 used for factory test only. d.6.3 qsm interrupt level register the values of ilqspi[2:0] and ilsci[2:0] in qilr determine the priority of qspi and sci interrupt requests. qilr ? qsm interrupt levels register $yffc04 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 ilqspi[2:0] ilsci[2:0] qivr reset: 0 0 0 0 0 0 0 0 336376umbook page 41 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-42 user? manual ilqspi[2:0] ?interrupt level for qspi when an interrupt request is made, ilqspi value determines which of the interrupt request signals is asserted; when a request is acknowledged, the qsm compares this value to a mask value supplied by the cpu32 to determine whether to respond. ilqspi must have a value in the range $0 (interrupts disabled) to $7 (highest priority). ilsci[2:0] ?interrupt level for sci when an interrupt request is made, ilsci value determines which of the interrupt request signals is asserted. when a request is acknowledged, the qsm compares this value to a mask value supplied by the cpu32 to determine whether to respond. the field must have a value in the range $0 (interrupts disabled) to $7 (highest priority). if ilqspi[2:0] and ilsci[2:0] have the same non-zero value, and both submodules simultaneously request interrupt service, the qspi has priority. d.6.4 qsm interrupt vector register qivr determines the value of the interrupt vector number the qsm supplies when it responds to an interrupt acknowledge cycle. at reset, qivr is initialized to $0f, the uninitialized interrupt vector number. to use interrupt-driven serial communication, a user-defined vector number must be written to qivr. intv[7:0] ?interrupt vector number the values of intv[7:1] are the same for both qspi and sci interrupt requests; the value of intv0 used during an interrupt acknowledge cycle is supplied by the qsm. intv0 is at logic level zero during an sci interrupt and at logic level one during a qspi interrupt. a write to intv0 has no effect. reads of intv0 return a value of one. d.6.5 sci control register sccr0 contains the sci baud rate selection field. baud rate must be set before the sci is enabled. the cpu32 can read and write sccr0 at any time. changing the value of sccr0 bits during a transfer operation can disrupt the transfer. bits [15:13] ?not implemented qivr qsm interrupt vector register $yffc05 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 qilr intv[7:0] reset: 0 0 0 0 1 1 1 1 sccr0 sci control register 0 $yffc08 15 13 12 11 10 9 8 7 6 5 4 3 2 1 0 not used scbr[12:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 336376umbook page 42 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-43 scbr[12:0] ?sci baud rate sci baud rate is programmed by writing a 13-bit value to this field. writing a value of zero to scbr disables the baud rate generator. baud clock rate is calculated as fol- lows: or where scbr[12:0] is in the range of 1 to 8191. d.6.6 sci control register 1 sccr1 contains sci configuration parameters, including transmitter and receiver en- able bits, interrupt enable bits, and operating mode enable bits. sccr0 can be read or written at any time. the sci can modify the rwu bit under certain circumstances. changing the value of sccr1 bits during a transfer operation can disrupt the transfer. bit 15 ?not implemented loops ?loop mode 0 = normal sci operation, no looping, feedback path disabled. 1 = test sci operation, looping, feedback path enabled. woms ?wired-or mode for sci pins 0 = if configured as an output, txd is a normal cmos output. 1 = if configured as an output, txd is an open-drain output. ilt ?idle-line detect type 0 = short idle-line detect (start count on first one). 1 = long idle-line detect (start count on first one after stop bit(s)). pt ?parity type 0 = even parity 1 = odd parity pe ?parity enable 0 = sci parity disabled. 1 = sci parity enabled. sccr1 sci control register 1 $yffc0a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 loops woms ilt pt pe m wake tie tcie rie ilie te re rwu sbk reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 sci baud rate f sys 32 scbr[12:0] -------------------------------------------- = scbr[12:0] f sys 32 sci baud rate desired -------------------------------------------------------------------------- - = 336376umbook page 43 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-44 user? manual m ?mode select 0 = 10-bit sci frame 1 = 11-bit sci frame wake ?wakeup by address mark 0 = sci receiver awakened by idle-line detection. 1 = sci receiver awakened by address mark (last bit set). tie ?transmit interrupt enable 0 = sci tdre interrupts disabled. 1 = sci tdre interrupts enabled. tcie ?transmit complete interrupt enable 0 = sci tc interrupts disabled. 1 = sci tc interrupts enabled. rie ?receiver interrupt enable 0 = sci rdrf and or interrupts disabled. 1 = sci rdrf and or interrupts enabled. ilie ?idle-line interrupt enable 0 = sci idle interrupts disabled. 1 = sci idle interrupts enabled. te ?transmitter enable 0 = sci transmitter disabled (txd pin can be used as i/o). 1 = sci transmitter enabled (txd pin dedicated to sci transmitter). re ?receiver enable 0 = sci receiver disabled. 1 = sci receiver enabled. rwu ?receiver wakeup 0 = normal receiver operation (received data recognized). 1 = wakeup mode enabled (received data ignored until receiver is awakened). sbk ?send break 0 = normal operation 1 = break frame(s) transmitted after completion of current frame. 336376umbook page 44 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-45 d.6.7 sci status register scsr contains flags that show sci operating conditions. these flags are cleared either by sci hardware or by a read/write sequence. the sequence consists of reading scsr, then reading or writing scdr. if an internal sci signal for setting a status bit comes after reading the asserted status bits, but before writing or reading scdr, the newly set status bit is not cleared. scsr must be read again with the bit set and scdr must be read or written before the status bit is cleared. a long-word read can consecutively access both scsr and scdr. this action clears receive status flag bits that were set at the time of the read, but does not clear tdre or tc flags. reading either byte of scsr causes all 16 bits to be accessed, and any status bit already set in either byte is cleared on a subsequent read or write of scdr. tdre ?transmit data register empty 0 = transmit data register still contains data to be sent to the transmit serial shifter. 1 = a new character can now be written to the transmit data register. tc ?transmit complete 0 = sci transmitter is busy. 1 = sci transmitter is idle. rdrf ?receive data register full 0 = receive data register is empty or contains previously read data. 1 = receive data register contains new data. raf ?receiver active 0 = sci receiver is idle. 1 = sci receiver is busy. idle ?idle-line detected 0 = sci receiver did not detect an idle-line condition. 1 = sci receiver detected an idle-line condition. or ?overrun error 0 = receive data register is empty and can accept data from the receive serial shifter. 1 = receive data register is full and cannot accept data from the receive serial shifter. any data in the shifter is lost and rdrf remains set. nf ?noise error flag 0 = no noise detected in the received data. 1 = noise detected in the received data. scsr sci status register $yffc0c 15 9 8 7 6 5 4 3 2 1 0 not used tdre tc rdrf raf idle or nf fe pf reset: 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 336376umbook page 45 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-46 user? manual fe ?framing error 0 = no framing error detected in the received data. 1 = framing error or break detected in the received data. pf ?parity error 0 = no parity error detected in the received data. 1 = parity error detected in the received data. d.6.8 sci data register scdr consists of two data registers located at the same address. the receive data register (rdr) is a read-only register that contains data received by the sci serial interface. data comes into the receive serial shifter and is transferred to rdr. the transmit data register (tdr) is a write-only register that contains data to be transmitted. data is first written to tdr, then transferred to the transmit serial shifter, where additional format bits are added before transmission. r[7:0]/t[7:0] contain either the first eight data bits received when scdr is read, or the first eight data bits to be transmitted when scdr is written. r8/t8 are used when the sci is configured for nine-bit operation. when the sci is configured for 8-bit operation, r8/t8 have no meaning or effect. d.6.9 port qs data register portqs latches i/o data. writes drive pins defined as outputs. reads return data present on the pins. to avoid driving undefined data, first write a byte to portqs, then configure ddrqs. scdr sci data register $yffc0e 15 9 8 7 6 5 4 3 2 1 0 not used r8/t8 r7/t7 r6/t6 r5/t5 r4/t4 r3/t3 r2/t2 r1/t1 r0/t0 reset: 0 0 0 0 0 0 0 u u u u u u u u u portqs port qs data register $yffc15 15 8 7 6 5 4 3 2 1 0 not used pqs7 pqs6 pqs5 pqs4 pqs3 pqs2 pqs1 pqs0 reset 0 0 0 0 0 0 0 0 336376umbook page 46 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-47 d.6.10 port qs pin assignment register/data direction register clearing a bit in pqspar assigns the corresponding pin to general-purpose i/o; set- ting a bit assigns the pin to the qspi. pqspar does not affect operation of the sci. table d-32 displays pqspar pin assignments. ddrqs determines whether pins configured for general purpose i/o are inputs or outputs. clearing a bit makes the corresponding pin an input; setting a bit makes the pin an output. ddrqs affects both qspi function and i/o function. table d-33 shows the effect of ddrqs on qsm pin function. notes: 1. pqs2 is a digital i/o pin unless the spi is enabled (spe in spcr1 set), in which case it becomes the qspi serial clock sck. 2. pqs7 is a digital i/o pin unless the sci transmitter is enabled (te in sccr1 = 1), in which case it becomes the sci serial output txd. pqspar port qs pin assignment register $yffc16 ddrqs ? port qs data direction register $yffc17 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 pqspa6 pqspa5 pqspa4 pqspa3 0 pqspa1 pqspa0 ddqs7 ddqs6 ddqs5 ddqs4 ddqs3 ddqs2 ddqs1 ddqs0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 table d-32 pqspar pin assignments pqspar field pqspar bit pin function pqspa0 0 1 pqs0 miso pqspa1 0 1 pqs1 mosi pqs2 1 sck pqspa3 0 1 pqs3 pcs0/ss pqspa4 0 1 pqs4 pcs1 pqspa5 0 1 pqs5 pcs2 pqspa6 0 1 pqs6 pcs3 pqs7 2 txd 336376umbook page 47 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-48 user? manual ddrqs determines the direction of the txd pin only when the sci transmitter is dis- abled. when the sci transmitter is enabled, the txd pin is an output. d.6.11 qspi control register 0 spcr0 contains parameters for configuring the qspi and enabling various modes of operation. the cpu32 has read/write access to spcr0, but the qsm has read access only. spcr0 must be initialized before qspi operation begins. writing a new value to spcr0 while the qspi is enabled disrupts operation. mstr ?master/slave mode select 0 = qspi is a slave device. 1 = qspi is the system master. womq ?wired-or mode for qspi pins 0 = pins designated for output by ddrqs operate in normal mode. 1 = pins designated for output by ddrqs operate in open-drain mode. notes: 1. pqs2 is a digital i/o pin unless the spi is enabled (spe set in spcr1), in which case it becomes the qspi serial clock sck. 2. pqs7 is a digital i/o pin unless the sci transmitter is enabled (te set in sccr1), in which case it becomes the sci serial data output txd. table d-33 effect of ddrqs on qsm pin function qsm pin mode ddrqs bit bit state pin function miso master ddqs0 0 serial data input to qspi 1 disables data input slave 0 disables data output 1 serial data output from qspi mosi master ddqs1 0 disables data output 1 serial data output from qspi slave 0 serial data input to qspi 1 disables data input sck 1 master ddqs2 clock output from qspi slave clock input to qspi pcs0/ss master ddqs3 0 assertion causes mode fault 1 chip-select output slave 0 qspi slave select input 1 disables slave select input pcs[1:3] master ddqs[4:6] 0 disables chip-select output 1 chip-select output slave 0 inactive 1 inactive txd 2 ddqs7 x serial data output from sci rxd none na serial data input to sci spcr0 qspi control register 0 $yffc18 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mstr womq bits[3:0] cpol cpha spbr[7:0] reset: 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 336376umbook page 48 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-49 bits[3:0] ?bits per transfer in master mode, when bitse is set in a command ram byte, bits[3:0] determines the number of data bits transferred. when bitse is cleared, eight bits are transferred. reserved values default to eight bits. in slave mode, the command ram is not used and the setting of bitse has no effect on qspi transfers. instead, the bits[3:0] field determines the number of bits the qspi will receive during each transfer before storing the received data. table d-34 shows the number of bits per transfer. cpol ?clock polarity 0 = the inactive state of sck is logic zero. 1 = the inactive state of sck is logic one. cpol is used to determine the inactive state of the serial clock (sck). it is used with cpha to produce a desired clock/data relationship between master and slave devices. cpha ?clock phase 0 = data is captured on the leading edge of sck and changed on the trailing edge of sck. 1 = data is changed on the leading edge of sck and captured on the trailing edge of sck cpha determines which edge of sck causes data to change and which edge causes data to be captured. cpha is used with cpol to produce a desired clock/data rela- tionship between master and slave devices. spbr[7:0] ?serial clock baud rate the qspi uses a modulus counter to derive the sck baud rate from the mcu system clock. baud rate is selected by writing a value from 2 to 255 into spbr[7:0]. the following equation determines the sck baud rate: table d-34 bits per transfer bits[3:0] bits per transfer 0000 16 0001 reserved 0010 reserved 0011 reserved 0100 reserved 0101 reserved 0110 reserved 0111 reserved 1000 8 1001 9 1010 10 1011 11 1100 12 1101 13 1110 14 1111 15 336376umbook page 49 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-50 user? manual or giving spbr[7:0] a value of zero or one disables the baud rate generator. sck is disabled and assumes its inactive state value. no serial transfers occur. at reset, the sck baud rate is initialized to one eighth of the system clock frequency. d.6.12 qspi control register 1 spcr1 enables the qspi and specified transfer delays. the cpu32 has read/write access to spcr1, but the qsm has read access only to all bits except spe. spcr1 must be written last during initialization because it contains spe. writing a new value to spcr1 while the qspi is enabled disrupts operation. spe ?qspi enable 0 = qspi is disabled. qspi pins can be used for general-purpose i/o. 1 = qspi is enabled. pins allocated by pqspar are controlled by the qspi. dsckl[6:0] ?delay before sck when the dsck bit is set in a command ram byte, this field determines the length of the delay from pcs valid to sck transition. pcs can be any of the four peripheral chip- select pins. the following equation determines the actual delay before sck: where dsckl[6:0] equals is in the range of 1 to 127. when dsck is zero in a command ram byte, then dsckl[6:0] is not used. instead, the pcs valid to sck transition is one-half the sck period. spcr1 qspi control register 1 $yffc1a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 spe dsckl[6:0] dtl[7:0] reset: 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 sck baud rate f sys 2 spbr[7:0] ------------------------------------- = spbr[7:0] f sys 2 sck baud rate desired -------------------------------------------------------------------------- = pcs to sck delay dsckl[6:0] f sys ------------------------------- = 336376umbook page 50 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-51 dtl[7:0] ?length of delay after transfer when the dt bit is set in a command ram byte, this field determines the length of the delay after a serial transfer. the following equation is used to calculate the delay: where dtl equals is in the range of 1 to 255. a zero value for dtl[7:0] causes a delay-after-transfer value of 8192 ? f sys . if dt is zero in a command ram byte, a standard delay is inserted. delay after transfer can be used to provide a peripheral deselect interval. a delay can also be inserted between consecutive transfers to allow serial a/d converters to com- plete conversion. d.6.13 qspi control register 2 spcr2 contains qspi queue pointers, wraparound mode control bits, and an interrupt enable bit. the cpu32 has read/write access to spcr2, but the qsm has read access only. spcr2 is buffered. new spcr2 values become effective only after completion of the current serial transfer. rewriting newqp in spcr2 causes execution to restart at the designated location. reads of spcr2 return the value of the register, not the buffer. spifie ?spi finished interrupt enable 0 = qspi interrupts disabled. 1 = qspi interrupts enabled. wren ?wrap enable 0 = wraparound mode disabled. 1 = wraparound mode enabled. wrto ?wrap to 0 = wrap to pointer address $0. 1 = wrap to address in newqp. bit 12 ?not implemented spcr2 qspi control register 2 $yffc1c 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 spifie wren wrto 0 endqp[3:0] 0 0 0 0 newqp[3:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 delay after transfer 32 dtl[7:0] system clock ------------------------------------ = standard delay after transfer 17 f sys -------- = 336376umbook page 51 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-52 user? manual endqp[3:0] ?ending queue pointer this field contains the last qspi queue address. bits [7:4] ?not implemented newqp[3:0] ?new queue pointer value this field contains the first qspi queue address. d.6.14 qspi control register 3 spcr3 contains the loop mode enable bit, halt and mode fault interrupt enable, and the halt control bit. the cpu32 has read/write access to spcr3, but the qsm has read access only. spcr3 must be initialized before qspi operation begins. writing a new value to spcr3 while the qspi is enabled disrupts operation. bits [15:11] ?not implemented loopq ?qspi loop mode 0 = feedback path disabled. 1 = feedback path enabled. loopq controls feedback on the data serializer for testing. hmie ?halta and modf interrupt enable 0 = halta and modf interrupts disabled. 1 = halta and modf interrupts enabled. hmie enables interrupt requests generated by the halta status flag or the modf status flag in spsr. halt ?halt qspi 0 = qspi operates normally. 1 = qspi is halted for subsequent restart. when halt is set, the qspi stops on a queue boundary. it remains in a defined state from which it can later be restarted. spcr3 qspi control register $yffc1e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 loopq hmie halt spsr reset: 0 0 0 0 0 0 0 0 336376umbook page 52 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-53 d.6.15 qspi status register spsr contains information concerning the current serial transmission. only the qspi can set bits in spsr. the cpu32 reads spsr to obtain qspi status information and writes it to clear status flags. spif ?qspi finished flag 0 = qspi is not finished. 1 = qspi is finished. spif is set after execution of the command at the address in endqp[3:0]. modf ?mode fault flag 0 = normal operation. 1 = another spi node requested to become the network spi master while the qspi was enabled in master mode (ss input taken low). the qspi asserts modf when the qspi is in master mode (mstr = 1) and the ss input pin is negated by an external driver. halta ?halt acknowledge flag 0 = qspi is not halted. 1 = qspi is halted. halta is set when the qspi halts in response to setting the spcr3 halt bit. bit 4 ?not implemented cptqp[3:0] ?completed queue pointer cptqp[3:0] points to the last command executed. it is updated when the current com- mand is complete. when the first command in a queue is executing, cptqp[3:0] con- tains either the reset value $0 or a pointer to the last command completed in the previous queue. d.6.16 receive data ram rr[0:f] receive data ram $yffd00 ?$yffd0e data received by the qspi is stored in this segment. the cpu32 reads this segment to retrieve data from the qspi. data stored in receive ram is right-justified. unused bits in a receive queue entry are set to zero by the qspi upon completion of the individual queue entry. receive ram data can be accessed using byte, word, or long- word addressing. spsr qspi status register $yffc1f 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 spcr3 spif modf halta 0 cptqp[3:0] reset: 0 0 0 0 0 0 0 0 336376umbook page 53 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-54 user? manual d.6.17 transmit data ram tr[0:f] transmit data ram $yffd20 ?$yffd3f data that is to be transmitted by the qspi is stored in this segment. the cpu32 normally writes one word of data into this segment for each queue command to be executed. information to be transmitted must be written to transmit data ram in a right-justified format. the qspi cannot modify information in the transmit data ram. the qspi copies the information to its data serializer for transmission. information re- mains in transmit ram until overwritten. d.6.18 command ram cr[0:f] command ram $yffd40 ?$yffd4f command ram is used by the qspi when in master mode. the cpu32 writes one byte of control information to this segment for each qspi command to be executed. the qspi cannot modify information in command ram. command ram consists of 16 bytes. each byte is divided into two fields. the periph- eral chip-select field enables peripherals for transfer. the command control field pro- vides transfer options. a maximum of 16 commands can be in the queue. queue execution proceeds from the address in newqp through the address in endqp (both of these fields are in spcr2). cont ?continue 0 = control of chip selects returned to portqs after transfer is complete. 1 = peripheral chip selects remain asserted after transfer is complete. bitse ?bits per transfer enable 0 = eight bits 1 = number of bits set in bits field of spcr0. dt ?delay after transfer 0 = delay after transfer is 17 ? f sys . 1 = spcr1 dtl[7:0] specifies delay after transfer pcs valid to sck. notes: 1. the pcs0 bit represents the dual-function pcs0/ss . 7 6 5 4 3 2 1 0 cont bitse dt dsck pcs3 pcs2 pcs1 pcs0 1 ? ? ? ? ? ? ? ? cont bitse dt dsck pcs3 pcs2 pcs1 pcs0 1 command control peripheral chip select 336376umbook page 54 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-55 dsck ?pcs to sck delay 0 = pcs valid to sck delay is one-half sck. 1 = spcr1 dsckl[6:0] specifies delay from pcs valid to sck. pcs[3:0] ?peripheral chip select use peripheral chip-select bits to select an external device for serial data transfer. more than one peripheral chip select may be activated at a time, and more than one peripheral chip can be connected to each pcs pin, provided proper fanout is observed. pcs0 shares a pin with the slave select (ss ) signal, which initiates slave mode serial transfer. if ss is taken low when the qspi is in master mode, a mode fault occurs. 336376umbook page 55 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-56 user? manual d.7 configurable timer module 4 table d-35 shows the ctm4 address map. all ctm4 control registers reside in super- visor space only. table d-35 ctm4 address map address 1 15 0 $yff400 biusm module configuration register (biumcr) $yff402 biusm test register (biutest) $yff404 biusm time base register (biutbr) $yff406 reserved $yff408 cpsm control register (cpcr) $yff40a cpsm test register (cptr) $yff40c ?$yff40e reserved $yff410 mcsm2 status/interrupt/control register (mcsm2sic) $yff412 mcsm2 counter (mcsm2cnt) $yff414 mcsm2 modulus latch (mcsm2ml) $yff416 reserved $yff418 dasm3 status/interrupt/control register (dasm3sic) $yff41a dasm3 register a (dasm3a) $yff41c dasm3 register b (dasm3b) $yff41e reserved $yff420 dasm4 status/interrupt/control register (dasm4sic) $yff422 dasm4 register a (dasm4a) $yff424 dasm4 register b (dasm4b) $yff426 reserved $yff428 pwmsm5 status/interrupt/control register (pwm5sic) $yff42a pwmsm5 period (pwm5a) $yff42c pwmsm5 pulse width (pwm5b) $yff42e pwmsm5 counter (pwm5c) $yff430 pwmsm6 status/interrupt/control register (pwm6sic) $yff432 pwmsm6 period (pwm6a) $yff434 pwmsm6 pulse width (pwm6b) $yff436 pwmsm6 counter (pwm6c) $yff438 pwmsm7 status/interrupt/control register (pwm7sic) $yff43a pwmsm7 period (pwm7a) $yff43c pwmsm7 pulse width (pwm7b) $yff43e pwmsm7 counter (pwm7c) $yff440 pwmsm8 status/interrupt/control register (pwm8sic) $yff442 pwmsm8 period (pwm8a) $yff444 pwmsm8 pulse width (pwm8b) $yff446 pwmsm8 counter (pwm8c) $yff448 dasm9 status/interrupt/control register (dasm9sic) $yff44a dasm9 register a (dasm9a) $yff44c dasm9 register b (dasm9b) $yff44e reserved $yff450 dasm10 status/interrupt/control register (dasm10sic) $yff452 dasm10 register a (dasm10a) $yff454 dasm10 register b (dasm10b) $yff456 reserved $yff458 mcsm11 status/interrupt/control register (mcsm11sic) 336376umbook page 56 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-57 d.7.1 biu module configuration register stop ?low-power stop mode enable when the stop bit is set, the clock to the ctm4 is shutdown, placing the module into low-power stop mode. the biusm still operates in low-power stop mode, allowing the submodule control and data registers to be accessed. 0 = enable ctm4 clocks. 1 = disable ctm4 clocks. frz ?freeze assertion response the frz bit controls ctm4 response to assertion of the imb freeze signal. since the biusm propagates freeze to the ctm4 submodules via the submodule bus, the setting of frz affects all ctm4 submodules. 0 = ctm4 ignores the imb freeze signal. 1 = ctm4 submodules freeze when the imb freeze signal is asserted. vect[7:6] ?interrupt vector base number this bit field selects the base interrupt vector number for the ctm4. of the eight bits necessary for a vector number, the six low-order bits are hardware defined on a sub- module basis, while the two remaining bits are provided by vect[7:6]. this places the ctm4 vectors in one of four possible positions in the interrupt vector table. refer to table d-36 . notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. $yff45a mcsm11 counter (mcsm11cnt) $yff45c mcsm11 modulus latch (mcsm11ml) $yff45e reserved $yff460 fcsm12 status/interrupt/control register (fcsm12sic) $yff462 fcsm12 counter (fcsm12cnt) $yff464 ?$yff4fe reserved biumcr ? biu module configuration register $yff400 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop frz not used vect[7:6] iarb[2:0] not used tbrs1 not used tbrs0 reset: 0 0 1 1 0 0 0 0 0 table d-36 interrupt vector base number bit field vect7 vect6 resulting base vector number 0 0 $00 0 1 $40 1 0 $80 1 1 $c0 table d-35 ctm4 address map (continued) address 1 15 0 336376umbook page 57 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-58 user? manual iarb[2:0] ?interrupt arbitration identification id this bit field and the iarb3 bit within each submodule capable of requesting interrupts determine the arbitration identification numbers for each submodule requesting interrupt service. tbrs1, tbrs0 ?time base register bus select bits these bits specify which time base bus is accessed when the time base register (biutbr) is read. refer to table d-37 . d.7.2 biusm test configuration register biutest ? biusm test configuration register $yff402 used only during factory test. d.7.3 biusm time base register biutbr is a read-only register used to read the value present on one of the time base buses. the time base bus accessed is determined by tbrs1 and tbrs0 in biumcr. d.7.4 cpsm control register prun ?prescaler running the prun bit is a read/write control bit that turns the prescaler counter on and off. this bit allows the counters in various ctm4 submodules to be synchronized. 0 = prescaler divider is held in reset and is not running. 1 = prescaler is running. table d-37 time base register bus select bits tbrs1 tbrs0 time base bus 0 0 tbb1 0 1 tbb2 1 0 tbb3 1 1 tbb4 biutbr ? biusm time base register $yff404 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cpcr ?cpsm control register $yff408 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 not used prun div23 psel[1:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 58 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-59 div23 ?divide by 2/divide by 3 the div23 bit is a read/write control bit that selects the division ratio of the first pres- caler stage. it may be changed at any time. 0 = first prescaler stage divides by two. 1 = first prescaler stage divides by three. psel[1:0] ?prescaler division ratio select this bit field selects the division ratio of the programmable prescaler output signal pclk6. refer to table d-38 . d.7.5 cpsm test register cptr ? cpsm test register $yff40a used only during factory test. d.7.6 fcsm status/interrupt/control register cof ?counter overflow flag this flag indicates whether or not a counter overflow has occurred. an overflow is de- fined as the transition of the counter from $ffff to $0000. if the il[2:0] field is non- zero, an interrupt request is generated when the cof bit is set. 0 = counter overflow has not occurred 1 = counter overflow has occurred this flag bit is set only by hardware and cleared by software or system reset. to clear the flag, first read the bit as a one, then write a zero to the bit. table d-38 prescaler division ratio select field prescaler control bits prescaler division ratio div23 psel1 psel0 pclk1 pclk2 pclk3 pclk4 pclk5 pclk6 000248163264 0012481632128 0102481632256 0112481632512 1003612244896 10136122448192 11036122448384 11136122448768 fcsmsic ? fcsm status/interrupt/control register $yff460 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cof il[2:0] iarb3 not used drva drvb in not used clk[2:0] reset: u 0 0 0 0 0 0 u 0 0 0 336376umbook page 59 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-60 user? manual il[2:0] ?interrupt level when the fcsm generates an interrupt request, il[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the ctm4 compares il[2:0] to a mask value supplied by the cpu32 to determine whether to respond. il[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). iarb3 ?interrupt arbitration bit 3 this bit and the iarb[2:0] field in biumcr are concatenated to determine the interrupt arbitration number for the submodule requesting interrupt service. refer to d.7.1 biu module configuration register for more information on iarb[2:0]. drv[a:b] ?drive time base bus this field controls the connection of the fcsm to time base buses a and b. refer to table d-39 . warning two time base buses should not be driven at the same time. in ?clock input pin status this read-only bit reflects the logic state of the clock input pin ctm2c. writing to this bit has no effect nor does reset. clk[2:0] ?counter clock select field these read/write control bits select one of the six cpsm clock signals (pclk[1:6]) or one of two external conditions on ctm2c to clock the free-running counter. the max- imum frequency of an external clock signal is f sys /4. refer to table d-40 . table d-39 drive time base bus field drva drvb bus selected 0 0 neither time base bus a nor bus b is driven 0 1 time base bus b is driven 1 0 time base bus a is driven 1 1 both time base bus a and bus b are driven table d-40 counter clock select field clk2 clk1 clk0 free running counter clock source 0 0 0 prescaler output 1 (/2 or /3) 0 0 1 prescaler output 2 (/4 or /6) 0 1 0 prescaler output 3 (/8 or /12) 0 1 1 prescaler output 4 (/16 or /24) 1 0 0 prescaler output 5 (/32 or /48) 1 0 1 prescaler output 6 (/64 or /512 or /96 to /768) 1 1 0 ctm2c input pin, negative edge 1 1 1 ctm2c input pin, positive edge 336376umbook page 60 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-61 d.7.7 fcsm counter register the fcsm counter register is a read/write register. a read returns the current value of the counter. a write loads the counter with the specified value. the counter then begins incrementing from this new value. d.7.8 mcsm status/interrupt/control registers cof ?counter overflow flag this bit indicates whether or not a counter overflow has occurred. an overflow of the mcsm counter is defined as the transition of the counter from $ffff to $xxxx, where $xxxx is the value contained in the modulus latch. if the il[2:0] field is non-zero, an interrupt request is generated when the cof bit is set. 0 = counter overflow has not occurred 1 = counter overflow has occurred this flag bit is set only by hardware and cleared only by software or by system reset. to clear the flag, first read the bit as a one, then write a zero to the bit. il[2:0] ?interrupt level field when the mcsm generates an interrupt request, il[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the ctm4 compares il[2:0] to a mask value supplied by the cpu32 to determine whether to respond. il[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). iarb3 ?interrupt arbitration bit 3 this bit and the iarb[2:0] field in biumcr are concatenated to determine the interrupt arbitration number for the submodule requesting interrupt service. refer to d.7.1 biu module configuration register for more information on iarb[2:0]. drv[a:b] ?drive time base bus this field controls the connection of the mcsm to time base buses a and b. refer to table d-41 . fcsmcnt ? fcsm counter register $yff462 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 mcsm2sic ? mcsm2 status/interrupt/control register $yff410 mcsm11sic ? mcsm11 status/interrupt/control register $yff458 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cof il[2:0] iarb3 not used drva drvb in2 in1 edgen edgep not used clk[2:0] reset: u 0 0 0 0 0 0 0 u u 0 0 0 0 0 0 336376umbook page 61 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-62 user? manual warning two time base buses should not be driven at the same time. in2 ?clock input pin status this read-only bit reflects the logic state of the clock input pin ctm2c. writing to this bit has no effect nor does reset. in1 ?modulus load input pin status this read-only bit reflects the logic state of the modulus load input pin ctd9. writing to this bit has no effect nor does reset. edgen, edgep ?modulus load edge sensitivity bits these read/write control bits select which edge on ctd9 triggers the modulus load input. refer to table d-42 . clk[2:0] ?counter clock select field these read/write control bits select one of the six cpsm clock signals (pclk[1:6]) or one of two external conditions on ctm2c to clock the modulus counter. the maximum frequency of an external clock signal is f sys /4. refer to table d-43 . table d-41 drive time base bus field drva drvb bus selected 0 0 neither time base bus a nor bus b is driven 0 1 time base bus b is driven 1 0 time base bus a is driven 1 1 both time base bus a and bus b are driven table d-42 modulus load edge sensitivity bits edgen edgep in1 edge detector sensitivity 0 0 none 0 1 positive edge only 1 0 negative edge only 1 1 positive and negative edge table d-43 counter clock select field clk2 clk1 clk0 free running counter clock source 0 0 0 prescaler output 1 (/2 or /3) 0 0 1 prescaler output 2 (/4 or /6) 0 1 0 prescaler output 3 (/8 or /12) 0 1 1 prescaler output 4 (/16 or /24) 1 0 0 prescaler output 5 (/32 or /48) 1 0 1 prescaler output 6 (/64 to /768) 1 1 0 ctm2c input pin, negative edge 1 1 1 ctm2c input pin, positive edge 336376umbook page 62 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-63 d.7.9 mcsm counter registers the mcsm counter register is a read/write register. a read returns the current value of the counter. a write simultaneously loads both the counter and the mcsm modulus latch with the specified value. the counter then begins incrementing from this new value. d.7.10 mcsm modulus latch registers the mcsm modulus latch register is a read/write register. a read returns the current value of the latch. a write pre-loads the latch with a new value that the modulus counter will begin counting from when the next load condition occurs. d.7.11 dasm status/interrupt/control registers flag ?event flag this status bit indicates whether or not an input capture or output compare event has occurred. if the il[2:0] field is non-zero, an interrupt request is generated when the flag bit is set. 0 = an input capture or output compare event has not occurred 1 = an input capture or output compare event has occurred table d-44 shows the status of the flag bit in different dasm operating modes. mcsm2cnt mcsm2 counter register $yff412 mcsm11cnt ? mcsm11 counter register $yff45a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 mcsm2ml ? mcsm2 modulus latch $yff414 mcsm11ml ? mcsm11 modulus latch $yff45c 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 dasm3sic ? dasm3 status/interrupt/control register $yff418 dasm4sic ? dasm4 status/interrupt/control register $yff420 dasm9sic ? dasm9 status/interrupt/control register $yff448 dasm10sic ? dasm10 status/interrupt/control register $yff450 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 flag il[2:0] iarb3 not used wor bsl in forca forcb edpol mode[3:0] reset: 0 0 0 0 0 0 0 u 0 0 0 0 0 0 0 336376umbook page 63 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-64 user? manual the flag bit is set by hardware and cleared by software, or by system reset. clear the flag bit either by writing a zero to it, having first read the bit as a one, or by se- lecting the dis mode. il[2:0] ?interrupt level when the dasm generates an interrupt request, il[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the ctm4 compares il[2:0] to a mask value supplied by the cpu32 to determine whether to respond. il[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). iarb3 ?interrupt arbitration bit 3 this bit and the iarb[2:0] field in biumcr are concatenated to determine the interrupt arbitration number for the submodule requesting interrupt service. refer to d.7.1 biu module configuration register for more information on iarb[2:0]. wor ?wired-or mode in the dis, ipwm, ipm and ic modes, the wor bit is not used. reading this bit returns the value that was previously written. in the ocb, ocab and opwm modes, the wor bit selects whether the output buffer is configured for open-drain or normal operation. 0 = output buffer operates in normal mode. 1 = output buffer operates in open-drain mode. bsl ?bus select this bit selects the time base bus connected to the dasm. 0 = dasm is connected to time base bus a. 1 = dasm is connected to time base bus b. in ?input pin status in the dis, ipwm, ipm and ic modes, this read-only status bit reflects the logic level on the input pin. in the ocb, ocab and opwm modes, reading this bit returns the value latched on the output flip-flop, after edpol polarity selection. writing to this bit has no effect. table d-44 dasm mode flag status bit states mode flag status bit state dis flag bit is reset ipwm flag bit is set each time there is a capture on channel a ipm flag bit is set each time there is a capture on channel a, except for the first time ic flag bit is set each time there is a capture on channel a ocb flag bit is set each time there is a successful comparison on channel b ocab flag bit is set each time there is a successful comparison on either channel a or b opwm flag bit is set each time there is a successful comparison on channel a 336376umbook page 64 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-65 forca ?force a in the ocb, ocab and opwm modes, forca bit allows software to force the output flip-flop to behave as if a successful comparison had occurred on channel a (except that the flag bit is not set). writing a one to forca sets the output flip-flop; writing a zero has no effect. in the dis, ipwm, ipm and ic modes, the forca bit is not used and writing to it has no effect. forca is cleared by reset, and always reads as zero. note writing a one to both forca and forcb simultaneously resets the output flip-flop. forcb ?force b in the ocb, ocab and opwm modes, forcb allows software to force the output flip- flop to behave as if a successful comparison had occurred on channel b (except that the flag bit is not set). writing a one to forcb sets the output flip-flop, writing a zero has no effect. in the dis, ipwm, ipm and ic modes, the forcb bit is not used and writing to it has no effect. forcb is cleared by reset, and always reads as zero. note writing a one to both forca and forcb simultaneously resets the output flip-flop. edpol ?edge polarity bit edpol selects different options depending on the dasm operating mode. refer to table d-45 . table d-45 edge polarity mode edpol function dis x edpol is not used in dis mode ipwm 0 channel a captures on a rising edge channel b captures on a falling edge 1 channel a captures on a falling edge channel b captures on a rising edge ipm, ic 0 channel a captures on a rising edge 1 channel a captures on a falling edge ocb, ocab, opwm 0 a compare on channel a sets the output pin to logic 1 a compare on channel b clears the output pin to logic 0 1 a compare on channel a clears the output pin to logic 0 a compare on channel b sets the output pin to logic 1 336376umbook page 65 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-66 user? manual mode[3:0] ?dasm mode select this bit field selects the mode of operation of the dasm. refer to table d-46 . note to avoid spurious interrupts, dasm interrupts should be disabled before changing the operating mode. d.7.12 dasm data register a dasma is the data register associated with channel a. table d-47 shows how dasma is used with the different modes of operation. table d-46 dasm mode select field mode[3:0] bits of resolution time base bits ignored dasm operating mode 0000 dis ?disabled 0001 16 ipwm ?input pulse width measurement 0010 16 ipm ?input measurement period 0011 16 ic ?input capture 0100 16 ocb ?output compare, flag on b compare 0101 16 ocab ?output compare, flag on a and b compare 011x not used 1000 16 opwm ?output pulse width modulation 1001 15 15 opwm ?output pulse width modulation 1010 14 [15:14] opwm ?output pulse width modulation 1011 13 [15:13] opwm ?output pulse width modulation 1100 12 [15:12] opwm ?output pulse width modulation 1101 11 [15:11] opwm ?output pulse width modulation 1110 9 [15:9] opwm ?output pulse width modulation 1111 7 [15:7] opwm ?output pulse width modulation dasm3a ? dasm3 data register a $yff41a dasm4a ? dasm4 data register a $yff422 dasm9a ? dasm9 data register a $yff44a dasm10a ? dasm10 data register a $yff452 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: u u u u u u u u u u u u u u u u 336376umbook page 66 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-67 d.7.13 dasm data register b dasmb is the data register associated with channel b. table d-48 shows how dasmb is used with the different modes of operation. depending on the mode select- ed, software access is to register b1 or register b2. table d-47 dasma operations mode dasma operation dis dasma can be accessed to prepare a value for a subsequent mode selection ipwm dasma contains the captured value corresponding to the trailing edge of the measured pulse ipm dasma contains the captured value corresponding to the most recently detected user-specified rising or falling edge ic dasma contains the captured value corresponding to the most recently detected user-specified rising or falling edge ocb dasma is loaded with the value corresponding to the leading edge of the pulse to be generated. writ- ing to dasma in the ocb and ocab modes also enables the corresponding channel a comparator until the next successful comparison. ocab dasma is loaded with the value corresponding to the leading edge of the pulse to be generated. writ- ing to dasma in the ocb and ocab modes also enables the corresponding channel a comparator until the next successful comparison. opwm dasma is loaded with the value corresponding to the leading edge of the pwm pulse to be generated. dasm3b ? dasm3 data register b $yff41c dasm4b ? dasm4 data register b $yff424 dasm9b ? dasm9 data register b $yff44c dasm10b ? dasm10 data register b $yff454 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: u u u u u u u u u u u u u u u u 336376umbook page 67 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-68 user? manual d.7.14 pwm status/interrupt/control register flag ?period completion status this status bit indicates when the pwm output period has been completed. 0 = pwm period is not complete. 1 = pwm period is complete. the flag bit is set each time a pwm period is completed. whenever the pwm is en- abled, the flag bit is set immediately to indicate that the contents of the buffer regis- ters pwma2 and pwmb2 have been updated, and that the period using these new values has started. it also indicates that the user accessible period and pulse width registers pwma1 and pwmb1 can be loaded with values for the next pwm period. once set, the flag bit remains set and is not affected by any subsequent period com- pletions, until it is cleared. only software can clear the flag bit. to clear flag, first read the bit as one then write a zero to the bit. writing a one to flag has no effect. when the pwm is disabled, flag remains cleared. table d-48 dasmb operations mode dasmb operation dis dasmb can be accessed to prepare a value for a subsequent mode selection. in this mode, register b1 is accessed in order to prepare a value for the opwm mode. unused register b2 is hidden and cannot be read, but is written with the same value as register b1 is written. ipwm dasmb contains the captured value corresponding to the trailing edge of the measured pulse. in this mode, register b2 is accessed. buffer register b1 is hidden and cannot be accessed. ipm dasmb contains the captured value corresponding to the most recently detected user-specified ris- ing or falling edge. in this mode, register b2 is accessed. buffer register b1 is hidden and cannot be accessed. ic dasmb contains the captured value corresponding to the most recently detected user-specified ris- ing or falling edge. in this mode, register b2 is accessed. buffer register b1 is hidden and cannot be accessed. ocb dasmb is loaded with the value corresponding to the trailing edge of the pulse to be generated. writ- ing to dasmb in the ocb and ocab modes also enables the corresponding channel b comparator until the next successful comparison. in this mode, register b2 is accessed. buffer register b1 is hid- den and cannot be accessed. ocab dasmb is loaded with the value corresponding to the trailing edge of the pulse to be generated. writ- ing to dasmb in the ocb and ocab modes also enables the corresponding channel b comparator until the next successful comparison. in this mode, register b2 is accessed. buffer register b1 is hid- den and cannot be accessed. opwm dasmb is loaded with the value corresponding to the trailing edge of the pwm pulse to be generat- ed. in this mode, register b1 is accessed. buffer register b2 is hidden and cannot be accessed. pwm5sic ? pwm5 status/interrupt/control register $yff428 pwm6sic ? pwm6 status/interrupt/control register $yff430 pwm7sic ? pwm7 status/interrupt/control register $yff438 pwm8sic ? pwm8 status/interrupt/control register $yff440 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 flag il[2:0] iarb3 not used pin not used load pol en clk[2:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 68 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-69 when the interrupt level set specified by il[2:0] is non-zero, an interrupt request is generated when the flag bit is set. il[2:0] ?interrupt level field when the pwmsm generates an interrupt request, il[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the ctm4 compares il[2:0] to a mask value supplied by the cpu32 to determine whether to respond. il[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). iarb3 ?interrupt arbitration bit 3 this bit and the iarb[2:0] field in biumcr are concatenated to determine the interrupt arbitration number for the submodule requesting interrupt service. refer to d.7.1 biu module configuration register for more information on iarb[2:0]. pin ?output pin status this status bit indicates the logic state present on the pwm output pin. 0 = logic zero present on the pwm output pin. 1 = logic one present on the pwm output pin. pin is a read-only bit; writing to it has no effect. load ?period and pulse width register load control setting load reinitializes the pwmsm and starts a new pwm period without causing a glitch on the output signal. 0 = no action 1 = load period and pulse width registers this bit is always read as a zero. writing a one to this bit results in the following imme- diate actions: ?the contents of pwma1 (period value) are transferred to pwma2. ?the contents of pwmb1 (pulse width value) are transferred to pwmb2. ?the counter register (pwmc) is initialized to $0001. ?the control logic and state sequencer are reset. ?the flag bit is set. ?the output flip-flop is set if the new value in pwmb2 is not $0000. note writing a one to the load bit when the en bit = 0, (when the pwmsm is disabled), has no effect. pol ?output pin polarity control this control bit sets the polarity of the pwm output signal. it works in conjunction with the en bit and controls whether the pwmsm drives the output pin with the non- inverted or inverted state of the output flip-flop. refer to table d-49 . 336376umbook page 69 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-70 user? manual en ?pwmsm enable this control bit enables and disables the pwmsm. 0 = disable the pwmsm. 1 = enable the pwmsm. while the pwmsm is disabled (en = 0): ?the output flip-flop is held in reset and the level on the output pin is set to one or zero according to the state of the pol bit. ?the pwmsm divide-by-256 prescaler is held in reset. ?the counter stops incrementing and is at $0001. ?the comparators are disabled. ?the pwma1 and pwmb1 registers permanently transfer their contents to the buffer registers pwma2 and pwmb2, respectively. when the en bit is changed from zero to one: ?the output flip-flop is set to start the first pulse. ?the pwmsm divide-by-256 prescaler is released. ?the counter is released and starts to increment from $0001. ?the flag bit is set to indicate that pwma1 and pwmb1 can be updated with new values. while en is set, the pwmsm continuously generates a pulse width modulated output signal based on the data in pwma2 and pwmb2 which are updated via pwma1 and pwmb2 each time a period is completed. note to prevent unwanted output waveform glitches when disabling the pwmsm, first write to pwmb1 to generate one period of 0% duty cycle, then clear en. clk[2:0] ?clock rate selection the clk[2:0] bits select one of the eight counter clock sources coming from the pwmsm prescaler. these bits can be changed at any time. table d-50 shows the counter clock sources and rates in detail. table d-49 pwmsm output pin polarity selection pol en output pin state periodic edge variable edge optional interrupt on 0 0 always low 1 0 always high 0 1 high pulse rising edge falling edge rising edge 1 1 low pulse falling edge rising edge falling edge 336376umbook page 70 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-71 d.7.15 pwm period register the pwma1 register contains the period value for the next cycle of the pwm output waveform. when the pwmsm is enabled, a period value written to pwma1 is loaded into pwma2 at the end of the current period or when the load bit in pwmsic is writ- ten to one. if the pwmsm is disabled, a period value written to pwma1 is loaded into pwma2 on the next half cycle of the mcu system clock. pwma2 is a temporary reg- ister that is used to smoothly update the pwm period value; it is not user-accessible. the pwmsm hardware does not modify the contents of pwma1 at any time. d.7.16 pwm pulse width register table d-50 pwmsm divide by options clk2 clk1 clk0 pclk1 = f sys ? 2 (cpcr div23 = 0) pclk1 = f sys ? 2 (cpcr div23 = 0) 000 f sys ? 2f sys ? 3 001 f sys ? 4f sys ? 6 010 f sys ? 8f sys ? 12 011 f sys ? 16 f sys ? 24 100 f sys ? 32 f sys ? 48 101 f sys ? 64 f sys ? 96 110 f sys ? 128 f sys ? 192 111 f sys ? 512 f sys ? 768 pwm5a1 ? pwm5a period register $yff42a pwm6a1 ? pwm6a period register $yff432 pwm7a1 ? pwm7a period register $yff43a pwm8a1 ? pwm8a period register $yff442 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: u u u u u u u u u u u u u u u u pwm5b1 ? pwm5 pulse width register $yff42c pwm6b1 ? pwm6 pulse width register $yff434 pwm7b1 ? pwm7 pulse width register $yff43c pwm8b1 ? pwm8 pulse width register $yff444 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: u u u u u u u u u u u u u u u u 336376umbook page 71 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-72 user? manual the pwmb1 register contains the pulse width value for the next cycle of the pwm out- put waveform. when the pwmsm is enabled, a pulse width value written to pwmb1 is loaded into pwmb2 at the end of the current period or when the load bit in pwm- sic is written to one. if the pwmsm is disabled, a pulse width value written to pwmb1 is loaded into pwmb2 on the next half cycle of the mcu system clock. pwmb2 is a temporary register that is used to smoothly update the pwm pulse width value; it is not user-accessible. the pwmsm hardware does not modify the contents of pwmb1 at any time. d.7.17 pwm counter register pwmc holds the current value of the pwmsm counter. pwmc can be read at any time; writing to it has no effect. pwmc is loaded with $0001 on reset and is set and held to that value whenever the pwmsm is disabled. pwm5c ? pwm5 counter register $yff42e pwm6c ? pwm6 counter register $yff436 pwm7c ? pwm7 counter register $yff43e pwm8c ? pwm8 counter register $yff446 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 72 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-73 d.8 time processor unit (tpu) table d-51 shows the tpu address map. the column labeled ?ccess?indicates the privilege level at which the cpu32 must be operating to access the register. a designation of ??indicates that supervisor mode is required. a designation of ?/u indicates that the register can be programmed for either supervisor mode access or unrestricted access. d.8.1 tpu module configuration register stop ?low-power stop mode enable 0 = enable tpu clocks. 1 = disable tpu clocks. notes: 1. y = m111, where m represents the logic state of the module mapping (mm) bit in the simcr. table d-51 tpu register map access address 1 15 0 s $yffe00 module configuration register (tpumcr) s $yffe02 test configuration register (tcr) s $yffe04 development support control register (dscr) s $yffe06 development support status register (dssr) s $yffe08 tpu interrupt configuration register (ticr) s $yffe0a channel interrupt enable register (cier) s $yffe0c channel function selection register 0 (cfsr0) s $yffe0e channel function selection register 1 (cfsr1) s $yffe10 channel function selection register 2 (cfsr2) s $yffe12 channel function selection register 3 (cfsr3) s/u $yffe14 host sequence register 0 (hsqr0) s/u $yffe16 host sequence register 1 (hsqr1) s/u $yffe18 host service request register 0 (hsrr0) s/u $yffe1a host service request register 1 (hsrr1) s $yffe1c channel priority register 0 (cpr0) s $yffe1e channel priority register 1 (cpr1) s $yffe20 channel interrupt status register (cisr) s $yffe22 link register (lr) s $yffe24 service grant latch register (sglr) s $yffe26 decoded channel number register (dcnr) tpumcr tpu module configuration register $yffe00 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop tcr1p[1:0] tcr2p[1:0] emu t2cg stf supv psck 0 0 iarb[3:0] reset: 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 336376umbook page 73 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-74 user? manual tcr1p[1:0] ?timer count register 1 prescaler control tcr1 is clocked from the output of a prescaler. the prescaler's input is the internal tpu system clock divided by either 4 or 32, depending on the value of the psck bit. the prescaler divides this input by 1, 2, 4, or 8. channels using tcr1 have the capa- bility to resolve down to the tpu system clock divided by four. table d-52 is a sum- mary of prescaler output. tcr2p[1:0] ?timer count register 2 prescaler control tcr2 is clocked from the output of a prescaler. if t2cg = 0, the input to the tcr2 prescaler is the external tcr2 clock source. if t2cg = 1, the input is the tpu system clock divided by eight. the tcr2p field specifies the value of the prescaler: 1, 2, 4, or 8. channels using tcr2 have the capability to resolve down to the tpu system clock divided by eight. table d-53 is a summary of prescaler output. emu ?emulation control in emulation mode, the tpu executes microinstructions from tpuram exclusively. access to the tpuram module via the imb is blocked, and the tpuram module is dedicated for use by the tpu. after reset, this bit can be written only once. 0 = tpu and tpuram operate normally. 1 = tpu and tpuram operate in emulation mode. t2cg ?tcr2 clock/gate control when t2cg is set, the external tcr2 pin functions as a gate of the div8 clock (the tpu system clock divided by eight). in this case, when the external tcr2 pin is low, the div8 clock is blocked, preventing it from incrementing tcr2. when the external tcr2 pin is high, tcr2 is incremented at the frequency of the div8 clock. when t2cg is cleared, an external clock input from the tcr2 pin, which has been synchro- nized and fed through a digital filter, increments tcr2. 0 = tcr2 pin used as clock source for tcr2. 1 = tcr2 pin used as gate of div8 clock for tcr2. table d-52 tcr1 prescaler control bits tcr1p[1:0] prescaler divide by tcr1 clock input psck = 0 psck = 1 00 1 f sys ? 32 f sys ? 4 01 2 f sys ? 64 f sys ? 8 10 4 f sys ? 128 f sys ? 16 11 8 f sys ? 256 f sys ? 32 table d-53 tcr2 prescaler control bits tcr2p[1:0] prescaler divide by internal clock divided by external clock divided by 00 1 8 1 01 2 16 2 10 4 32 4 11 8 64 8 336376umbook page 74 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-75 stf ?stop flag 0 = tpu is operating. 1 = tpu is stopped (stop bit has been set). supv ?supervisor/unrestricted 0 = assignable registers are accessible in user or supervisor mode. 1 = assignable registers are accessible in supervisor mode only. psck ?prescaler clock 0 = f sys ? 32 is input to tcr1 prescaler. 1 = f sys ? 4 is input to tcr1 prescaler. iarb[3:0] ? interrupt arbitration id the iarb field is used to arbitrate between simultaneous interrupt requests of the same priority. each module that can generate interrupt requests must be assigned a unique, non-zero iarb field value. d.8.2 test configuration register tcr ?test configuration register $yffe02 used for factory test only. d.8.3 development support control register hot4 ?hang on t4 0 = exit wait on t4 state caused by assertion of hot4. 1 = enter wait on t4 state. blc ?branch latch control 0 = latch conditions into branch condition register before exiting halted state. 1 = do not latch conditions into branch condition register before exiting the halted state or during the time-slot transition period. clks ?stop clocks (to tcrs) 0 = do not stop tcrs. 1 = stop tcrs during the halted state. frz[1:0] ?freeze assertion response the frz bits specify the tpu microengine response to the imb freeze signal. refer to table d-54 . dscr ?development support control register $yffe04 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 hot4 not used blc clks frz[1:0] ccl bp bc bh bl bm bt reset: 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 75 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-76 user? manual ccl ?channel conditions latch ccl controls the latching of channel conditions (mrl and tdl) when the chan reg- ister is written. 0 = only the pin state condition of the new channel is latched as a result of the write chan register microinstruction. 1 = pin state, mrl, and tdl conditions of the new channel are latched as a result of a write chan register microinstruction. bp, bc, bh, bl, bm, and bt ?breakpoint enable bits these bits are tpu breakpoint enables. setting a bit enables a breakpoint condition. table d-55 shows the different breakpoint enable bits. d.8.4 development support status register bkpt ?breakpoint asserted flag if an internal breakpoint caused the tpu to enter the halted state, the tpu asserts the bkpt signal on the imb and sets the bkpt flag. bkpt remains set until the tpu recognizes a breakpoint acknowledge cycle, or until the imb freeze signal is asserted. pcbk ? m pc breakpoint flag pcbk is asserted if a breakpoint occurs because of a m pc (microprogram counter) register match with the m pc breakpoint register. pcbk is negated when the bkpt flag is cleared. table d-54 frz[1:0] encoding frz[1:0] tpu response 00 ignore freeze 01 reserved 10 freeze at end of current microcycle 11 freeze at next time-slot boundary table d-55 breakpoint enable bits enable bit function bp break if m pc equals m pc breakpoint register bc break if chan register equals channel breakpoint register at beginning of state or when chan is changed through microcode bh break if host service latch is asserted at beginning of state bl break if link service latch is asserted at beginning of state bm break if mrl is asserted at beginning of state bt break if tdl is asserted at beginning of state dssr ?development support status register $yffe06 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 bkpt pcbk chbk srbk tpuf 0 0 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 76 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-77 chbk ?channel register breakpoint flag chbk is asserted if a breakpoint occurs because of a chan register match with the chan register breakpoint register. chbk is negated when the bkpt flag is cleared. srbk ?service request breakpoint flag srbk is asserted if a breakpoint occurs because of any of the service request latches being asserted along with their corresponding enable flag in the development support control register. srbk is negated when the bkpt flag is cleared. tpuf ?tpu freeze flag tpuf is set whenever the tpu is in a halted state as a result of freeze being as- serted. this flag is automatically negated when the tpu exits the halted state because of freeze being negated. d.8.5 tpu interrupt configuration register cirl[2:0] ?channel interrupt request level this three-bit field specifies the interrupt request level for all channels. level seven for this field indicates a non-maskable interrupt; level zero indicates that all channel inter- rupts are disabled. cibv[3:0] ?channel interrupt base vector the tpu is assigned 16 unique interrupt vector numbers, one vector number for each channel. the cibv field specifies the most significant nibble of all 16 tpu channel in- terrupt vector numbers. the lower nibble of the tpu interrupt vector number is deter- mined by the channel number on which the interrupt occurs. d.8.6 channel interrupt enable register ch[15:0] ?channel interrupt enable/disable 0 = channel interrupts disabled 1 = channel interrupts enabled ticr tpu interrupt configuration register $yffe08 15 10 9 8 7 6 5 4 3 0 not used cirl[2:0] cibv[3:0] not used reset: 0 0 0 0 0 0 0 cier channel interrupt enable register $yffe0a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 15 ch 14 ch 13 ch 12 ch 11 ch 10 ch 9 ch 8 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 77 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-78 user? manual d.8.7 channel function select registers channel[15:0] ?encoded time function for each channel encoded four-bit fields in the channel function select registers specify one of 16 time functions to be executed on the corresponding channel. d.8.8 host sequence registers cfsr0 channel function select register 0 $yffe0c 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 channel 15 channel 14 channel 13 channel 12 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cfsr1 channel function select register 1 $yffe0e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 channel 11 channel 10 channel 9 channel 8 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cfsr2 channel function select register 2 $yffe10 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 channel 7 channel 6 channel 5 channel 4 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cfsr3 channel function select register 3 $yffe12 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 channel 3 channel 2 channel 1 channel 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hsqr0 host sequence register 0 $yffe14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 15 ch 14 ch 13 ch 12 ch 11 ch 10 ch 9 ch 8 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hsqr1 host sequence register 1 $yffe16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 78 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-79 ch[15:0] ?encoded host sequence the host sequence field selects the mode of operation for the time function selected on a given channel. the meaning of the host sequence bits depends on the time function specified. d.8.9 host service request registers ch[15:0] ?encoded type of host service the host service request field selects the type of host service request for the time function selected on a given channel. the meaning of the host service request bits depends on the time function specified. a host service request field cleared to %00 signals the host that service is completed by the microengine on that channel. the host can request service on a channel by writing the corresponding host service request field to one of three non-zero states. the cpu32 should monitor the host service request register until the tpu clears the service request to %00 before any parameters are changed or a new service request is issued to the channel. d.8.10 channel priority registers hssr0 host service request register 0 $yffe18 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 15 ch 14 ch 13 ch 12 ch 11 ch 10 ch 9 ch 8 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 hssr1 host service request register 1 $yffe1a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cpr0 ? channel priority register 0 $yffe1c 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 15 ch 14 ch 13 ch 12 ch 11 ch 10 ch 9 ch 8 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 cpr1 channel priority register 1 $yffe1e 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 79 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-80 user? manual ch[15:0] ?encoded channel priority levels table d-56 shows channel priority levels. d.8.11 channel interrupt status register ch[15:0] ?channel interrupt status 0 = channel interrupt not asserted. 1 = channel interrupt asserted. d.8.12 link register lr ? link register $yffe22 used for factory test only. d.8.13 service grant latch register sglr ?service grant latch register $yffe24 used for factory test only. d.8.14 decoded channel number register dcnr ?decoded channel number register $yffe26 used for factory test only. d.8.15 tpu parameter ram the channel parameter registers are organized as one hundred 16-bit words of ram. channels 0 to 13 have six parameters. channels 14 and 15 each have eight parame- ters. the parameter registers constitute a shared work space for communication be- tween the cpu32 and the tpu. refer to table d-57 . table d-56 channel priorities chx[1:0] service guaranteed time slots 00 disabled 01 low 1 out of 7 10 middle 2 out of 7 11 high 4 out of 7 cisr ? channel interrupt status register $yffe20 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ch 15 ch 14 ch 13 ch 12 ch 11 ch 10 ch 9 ch 8 ch 7 ch 6 ch 5 ch 4 ch 3 ch 2 ch 1 ch 0 reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 80 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-81 notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. 2. ## = not implemented. table d-57 parameter ram address map channel base parameter number address 0 1 2 3 4 5 6 7 0 $yfff## 1, 2 00 02 04 06 08 0a 1 $yfff## 10 12 14 16 18 1a 2 $yfff## 20 22 24 26 28 2a 3 $yfff## 30 32 34 36 38 3a 4 $yfff## 40 42 44 46 48 4a 5 $yfff## 50 52 54 56 58 5a 6 $yfff## 60 62 64 66 68 6a 7 $yfff## 70 72 74 76 78 7a 8 $yfff## 80 82 84 86 88 8a 9 $yfff## 90 92 94 96 98 9a 10 $yfff## a0 a2 a4 a6 a8 aa 11 $yfff## b0 b2 b4 b6 b8 ba 12 $yfff## c0 c2 c4 c6 c8 ca 13 $yfff## d0 d2 d4 d6 d8 da 14 $yfff## e0 e2 e4 e6 e8 ea ec ee 15 $yfff## f0 f2 f4 f6 f8 fa fc fe 336376umbook page 81 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-82 user? manual d.9 standby ram module with tpu emulation capability (tpuram) table d-58 is the tpuram address map. tpuram responds to both program and data space accesses. the rasp bit in trammcr determines whether the processor must be operating in supervisor mode to access the array. tpuram control registers are accessible in supervisor mode only. d.9.1 tpuram module configuration register stop ?low-power stop mode enable 0 = tpuram operates normally. 1 = tpuram enters low-power stop mode. this bit controls whether tpuram operates normally or enters low-power stop mode. in low-power stop mode, the array retains its contents, but cannot be read or written. rasp ?tpuram array space 0 = tpuram is accessible in supervisor or user space. 1 = tpuram is accessible in supervisor space only. d.9.2 tpuram test register tramtst ?tpuram test register $yffb02 used for factory test only. d.9.3 tpuram module configuration register notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in the simcr. table d-58 tpuram address map address 1 15 0 $yffb00 tpuram module configuration register (trammcr) $yffb02 tpuram test register (tramtst) $yffb04 tpuram base address and status register (trambar) $yffb06 ?$yffb3f not used trammcr ?tpuram module configuration register $yffb00 15 14 13 12 11 10 9 8 7 0 stop 0 0 0 0 0 0 rasp not used reset: 0 0 0 0 0 0 0 1 trambar tpuram base address and status register $yffb04 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 addr 23 addr 22 addr 21 addr 20 addr 19 addr 18 addr 17 addr 16 addr 15 addr 14 addr 13 addr 12 0 0 0 ramds reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 82 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-83 addr[23:11] ?tpuram array base address these bits specify addr[23:12] of the base address of the tpuram array when enabled. the 3.5-kbyte array resides at the lower end of the 4-kbyte page into which it is mapped. ramds ?ram array disable 0 = ram array is enabled. 1 = ram array is disabled. ramds indicates whether the tpuram is active or disabled. the array is disabled at reset. writing a valid base address into trambar clears the ramds bit and enables the array. 336376umbook page 83 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-84 user? manual d.10 toucan module the toucan is used only in the mc68376. table d-59 shows the toucan address map. the column labeled ?ccess?indicates the privilege level at which the cpu32 must be operating to access the register. a designation of ??indicates that supervisor mode is required. a designation of ?/u?indicates that the register can be pro- grammed for either supervisor mode access or unrestricted access. toucan module address space is split, with 128 bytes starting at the base address, and an extra 256 bytes starting at the base address +128. the upper 256 are fully used for the message buffer structures. of the lower 128 bytes, only part is occupied by var- ious registers. registers with bits marked as ?eserved?should always be written as logic 0. notes: 1. y = m111, where m is the logic state of the module mapping (mm) bit in simcr. table d-59 toucan address map access address 1 15 8 7 0 s $yff080 toucan module configuration register (canmcr) s $yff082 toucan test configuration register (cantcr) s $yff084 toucan interrupt register (canicr) s/u $yff086 control register 0 (canctrl0) control register 1 (canctrl1) s/u $yff088 prescaler divider register (presdiv) control register 2 (canctrl2) s/u $yff08a free-running timer register (timer) reserved s/u $yff090 receive global mask high (rxgmskhi) s/u $yff092 receive global mask low (rxgmsklo) s/u $yff094 receive buffer 14 mask high (rx14mskhi) s/u $yff096 receive buffer 14 mask low (rx14msklo) s/u $yff098 receive buffer 15 mask high (rx15mskhi) s/u $yff09a receive buffer 15 mask low (rx15msklo) reserved s/u $yff0a0 error and status register (estat) s/u $yff0a2 interrupt masks (imask) s/u $yff0a4 interrupt flags (iflag) s/u $yff0a6 receive error counter (rxectr) transmit error counter (txectr) 336376umbook page 84 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-85 figure d-3 toucan message buffer address map d.10.1 toucan module configuration register stop ?low-power stop mode enable the stop bit may only be set by the cpu32. it may be cleared either by the cpu32 or by the toucan, if the selfwake bit is set. 0 = enable toucan clocks 1 = disable toucan clocks frz ?freeze assertion response when frz = 1, the toucan can enter debug mode when the imb freeze line is as- serted, or the halt bit is set. clearing of this bit field causes the toucan to exit debug mode. refer to 13.6.1 debug mode for more information. 0 = toucan ignores the imb freeze signal and the halt bit in the module configuration register. 1 = allows the toucan module to enter debug mode. canmcr ? toucan module configuration register $yff080 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stop frz not used halt not rdy wake msk soft rst frz ack supv self wake aps stop ack iarb[3:0] reset: 0 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 toucan message buffer map $yff100 $yff102 id low message buffer 0 $yff104 $yff106 $yff10c $yff10e $yff110 message buffer 1 $yff120 $yff1ff message buffer 2 message buffer 15 control/status id high 8-byte data field reserved 336376umbook page 85 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-86 user? manual halt ?halt toucan s-clock setting the halt bit has the same effect as assertion of the imb freeze signal on the toucan without requiring that freeze be asserted. this bit is set to one after reset. it should be cleared after initializing the message buff- ers and control registers. toucan message buffer receive and transmit functions are inactive until this bit is cleared. when halt is set, the write access to certain registers and bits that are normally read- only is allowed. 0 = the toucan operates normally. 1 = place toucan in debug mode if frz = 1. notrdy ?toucan not ready the notrdy bit indicates that the toucan is either in low-power stop mode or debug mode. this bit is read-only and is set only when the toucan enters low-power stop mode or debug mode. it is cleared once the toucan exits either mode, either by synchroniza- tion to the can bus or by the self-wake mechanism. 0 = toucan has exited low-power stop mode or debug mode. 1 = toucan is in low-power stop mode or debug mode. wakemsk ?wakeup interrupt mask the wakemsk bit enables wake-up interrupt requests. 0 = wake up interrupt is disabled. 1 = wake up interrupt is enabled. softrst ?soft reset when the softrst bit is asserted, the toucan resets its internal state machines (sequencer, error counters, error flags, and timer) and the host interface registers (canmcr, canicr, cantcr, imask, and iflag). the configuration registers that control the interface with the can bus are not changed (canctrl[0:2] and presdiv). message buffers and receive message masks are also not changed. this allows softrst to be used as a debug feature while the sys- tem is running. setting softrst also clears the stop bit in canmcr. after setting softrst, allow one complete bus cycle to elapse for the internal toucan circuitry to completely reset before executing another access to canmcr. this bit is cleared by the toucan once the internal reset cycle is completed. 0 = soft reset cycle completed 1 = soft reset cycle initiated 336376umbook page 86 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-87 frzack ?toucan disable when the toucan enters debug mode, it sets the frzack bit. this bit should be polled to determine if the toucan has entered debug mode. when debug mode is ex- ited, this bit is negated once the toucan prescaler is enabled. this is a read-only bit. 0 = the toucan has exited debug mode and the prescaler is enabled. 1 = the toucan has entered debug mode, and the prescaler is disabled. supv ?supervisor/user data space the supv bit places the toucan registers in either supervisor or user data space. 0 = registers with access controlled by the supv bit are accessible in either user or supervisor privilege mode. 1 = registers with access controlled by the supv bit are restricted to supervisor mode. selfwake ?self wake enable the selfwake bit allows the toucan to wake up when bus activity is detected after the stop bit is set. if this bit is set when the toucan enters low-power stop mode, the toucan will monitor the bus for a recessive to dominant transition. if a recessive to dominant transition is detected, the toucan immediately clears the stop bit and restarts its clocks. if a write to canmcr with selfwake set occurs at the same time a recessive-to- dominant edge appears on the can bus, the bit will not be set, and the module clocks will not stop. the user should verify that this bit has been set by reading canmcr. refer to 13.6.2 low-power stop mode for more information on entry into and exit from low-power stop mode. 0 = self wake disabled. 1 = self wake enabled. note the selfwake bit should not be set if the lpstop instruction is to be executed because lpstop stops all system clocks, thus shutting down all modules. aps ?auto power save the aps bit allows the toucan to automatically shut off its clocks to save power when it has no process to execute, and to automatically restart these clocks when it has a task to execute without any cpu32 intervention. 0 = auto power save mode disabled; clocks run normally. 1 = auto power save mode enabled; clocks stop and restart as needed. stopack ?stop acknowledge when the toucan is placed in low-power stop mode and shuts down its clocks, it sets the stopack bit. this bit should be polled to determine if the toucan has entered low-power stop mode. when the toucan exits low-power stop mode, the stopack bit is cleared once the toucan? clocks are running. 336376umbook page 87 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-88 user? manual 0 = the toucan is not in low-power stop mode and its clocks are running. 1 = the toucan has entered low-power stop mode and its clocks are stopped iarb[3:0] ?interrupt arbitration id the iarb field is used to arbitrate between simultaneous interrupt requests of the same priority. each module that can generate interrupt requests must be assigned a unique, non-zero iarb field value. d.10.2 toucan test configuration register cantcr ? toucan test configuration register $yff082 used for factory test only. d.10.3 toucan interrupt configuration register ilcan[2:0] ?interrupt request level when the toucan generates an interrupt request, ilcan[2:0] determines which of the interrupt request signals is asserted. when a request is acknowledged, the toucan compares ilcan[2:0] to a mask value supplied by the cpu32 to determine whether to respond. ilcan[2:0] must have a value in the range of $0 (interrupts disabled) to $7 (highest priority). ivba[2:0] ?interrupt vector base address the interrupt vector base address specifies the high-order three bits of all the vector numbers generated by the different toucan interrupt sources. note if the toucan issues an interrupt request after reset and before ivba[2:0] is initialized, it will drive $0f as the ?ninitialized?interrupt vector in response to a cpu32 interrupt acknowledge cycle, regard- less of the specific event. d.10.4 control register 0 canicr ? toucan interrupt configuration register $yff084 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved ilcan[2:0] ivba[2:0] reserved reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 canctrl0 ? control register 0 $yff086 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 boff msk err msk reserved rxmode[1:0] txmode[1:0] canctrl1 reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 336376umbook page 88 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-89 boffmsk ?bus off interrupt mask the boffmsk bit provides a mask for the bus off interrupt. 0 = bus off interrupt disabled. 1 = bus off interrupt enabled. errmsk ?error interrupt mask the errmsk bit provides a mask for the error interrupt. 0 = error interrupt disabled. 1 = error interrupt enabled. rxmode[1:0] ?receive pin configuration control these bits control the configuration of the canrx0 and canrx1 pins. refer to the table d-60 . txmode[1:0] ?transmit pin configuration control this bit field controls the configuration of the cantx0 and cantx1 pins. refer to the table d-61 . notes: 1. canrx1 is not present on the mc68376. notes: 1. full cmos drive indicates that both dominant and recessive levels are driven by the chip. 2. cantx1 is not present on the mc68376. 3. if negative polarity is activated when the loop bit in canctrl1 is set, the rx mode bit field should also be set to assure proper operation. 4. open drain drive indicates that only a dominant level is driven by the chip. during a reces- sive level, the cantx0 and cantx1 pins are disabled (three stated), and the electrical lev- el is achieved by external pull-up/pull-down devices. the assertion of both tx mode bits causes the polarity inversion to be cancelled (open drain mode forces the polarity to be positive). table d-60 rx mode[1:0] configuration pin rx1 rx0 receive pin configuration canrx1 1 0x a logic 0 on the canrx1 pin is interpreted as a dominant bit; a logic 1 on the canrx1 pin is interpreted as a recessive bit 1x a logic 1 on the canrx1 pin is interpreted as a dominant bit; a logic 0 on the canrx1 pin is interpreted as a recessive bit canrx0 x0 a logic 0 on the canrx0 pin is interpreted as a dominant bit; a logic 1 on the canrx0 pin is interpreted as a recessive bit x1 a logic 1 on the canrx0 pin is interpreted as a dominant bit; a logic 0 on the canrx0 pin is interpreted as a recessive bit table d-61 transmit pin configuration txmode[1:0] transmit pin configuration 00 full cmos 1 ; positive polarity (cantx0 = 0, cantx1 = 1 2 is a dominant level) 01 full cmos; negative polarity 3 (cantx0 = 1, cantx1 = 0 is a dominant level) 1x open drain 4 ; positive polarity 336376umbook page 89 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-90 user? manual d.10.5 control register 1 samp ?sampling mode the samp bit determines whether the toucan module will sample each received bit one time or three times to determine its value. 0 = one sample, taken at the end of phase buffer segment 1, is used to determine the value of the received bit. 1 = three samples are used to determine the value of the received bit. the sam- ples are taken at the normal sample point, and at the two preceding periods of the s-clock. loop ?toucan loop back the loop bit configures the toucan to perform internal loop back. the bit stream output of the transmitter is fed back to the receiver. the receiver ignores the canrx0 and canrx1 pins. the cantx0 and cantx1 pins output a recessive state. in this state, the toucan ignores the ack bit to ensure proper reception of its own messag- es. 0 = internal loop back disabled. 1 = internal loop back enabled. tsync ?timer synchronize mode the tsync bit enables the mechanism that resets the free-running timer each time a message is received in message buffer 0. this feature provides the means to synchro- nize multiple toucan stations with a special ?ync?message (global network time). 0 = timer synchronization disabled. 1 = timer synchronization enabled. note there can be a bit clock skew of four to five counts between different toucan modules that are using this feature on the same network. lbuf ?lowest buffer transmitted first the lbuf bit defines the transmit-first scheme. 0 = message buffer with lowest id is transmitted first. 1 = lowest numbered buffer is transmitted first. propseg[2:0] ?propagation segment time propseg defines the length of the propagation segment in the bit time. the valid pro- grammed values are 0 to 7. the propagation segment time is calculated as follows: canctrl1 ? control register 1 $yff087 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 canctrl0 samp loop tsync lbuf rsvd propseg[2:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 90 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-91 where d.10.6 prescaler divide register presdiv ?prescaler divide factor presdiv determines the ratio between the system clock frequency and the serial clock (s-clock). the s-clock is determined by the following calculation: the reset value of presdiv is $00, which forces the s-clock to default to the same frequency as the system clock. the valid programmed values are 0 through 255. d.10.7 control register 2 rjw[1:0] ?resynchronization jump width the rjw field defines the maximum number of time quanta a bit time may be changed during resynchronization. the valid programmed values are 0 through 3. the resynchronization jump width is calculated as follows: presdiv ? prescaler divide register $yff088 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 presdiv canctrl2 reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 canctrl2 ? control register 2 $yff089 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 presdiv rjw[1:0] pseg1[2:0] pseg2[2:0] reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 propagation segment time propseg 1 + () time quanta = 1 time quantum 1 serial clock (s-clock) period = s-clock f sys presdiv 1 + ----------------------------------- - = resynchronization jump width rjw 1 + () time quanta = 336376umbook page 91 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-92 user? manual pseg1[2:0] ?phase buffer segment 1 the pseg1 field defines the length of phase buffer segment 1 in the bit time. the valid programmed values are 0 through 7. the length of phase buffer segment 1 is calculated as follows: pseg2 ?phase buffer segment 2 the pseg2 field defines the length of phase buffer segment 2 in the bit time. the valid programmed values are 0 through 7. the length of phase buffer segment 2 is calculated as follows: d.10.8 free running timer the free running timer counter can be read and written by the cpu32. the timer starts from zero after reset, counts linearly to $ffff, and wraps around. the timer is clocked by the toucan bit-clock. during a message, it increments by one for each bit that is received or transmitted. when there is no message on the bus, it increments at the nominal bit rate. the timer value is captured at the beginning of the identifier field of any frame on the can bus. the captured value is written into the ?ime stamp?entry in a message buffer after a successful reception/transmission of a message. timer ? free running timer register $yff08a 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 timer reset: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 phase buffer segment 1 pseg1 1 + () time quanta = phase buffer segment 2 pseg2 1 + () time quanta = 336376umbook page 92 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-93 d.10.9 receive global mask registers the receive global mask registers use four bytes. the mask bits are applied to all receive-identifiers, excluding receive-buffers 14-15, which have their own specific mask registers. base id mask bits mid[28:18] are used to mask standard or extended format frames. extended id bits mid[17:0] are used to mask only extended format frames. the rtr/srr bit of a received frame is never compared to the corresponding bit in the message buffer id field. however, remote request frames (rtr = 1) once received, are never stored into the message buffers. rtr mask bit locations in the mask registers (bits 20 and 0) are always zero, regardless of any write to these bits. the ide bit of a received frame is always compared to determine if the message contains a standard or extended identifier. its location in the mask registers (bit 19) is always one, regardless of any write to this bit. d.10.10 receive buffer 14 mask registers rx14mskhi ? receive buffer 14 mask register high $yff094 rx14msklo ? receive buffer 14 mask register low $yff096 the receive buffer 14 mask registers have the same structure as the receive global mask registers and are used to mask buffer 14. d.10.11 receive buffer 15 mask registers rx15mskhi ? receive buffer 15 mask register high $yff098 rx15msklo ? receive buffer 15 mask register low $yff09a the receive buffer 15 mask registers have the same structure as the receive global mask registers and are used to mask buffer 15. rxgmskhi ? receive global mask register high $yff090 rxgmsklo ? receive global mask register low $yff092 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 mid28 mid27 mid26 mid25 mid24 mid23 mid22 mid21 mid20 mid19 mid18 0 1 mid17 mid16 mid15 reset: 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mid14 mid13 mid12 mid11 mid10 mid9 mid8 mid7 mid6 mid5 mid4 mid3 mid2 mid1 mid0 0 reset: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 336376umbook page 93 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-94 user? manual d.10.12 error and status register this register reflects various error conditions, general status, and has the enable bits for three of the toucan interrupt sources. the reported error conditions are those which have occurred since the last time the register was read. a read clears these bits to zero. biterr[1:0] ?transmit bit error the biterr[1:0] field is used to indicate when a transmit bit error occurs. refer to ta- ble d-62 . note the transmit bit error field is not modified during the arbitration field or the ack slot bit time of a message, or by a transmitter that detects dominant bits while sending a passive error frame. ackerr ?acknowledge error the ackerr bit indicates whether an acknowledgment has been correctly received for a transmitted message. 0 = no ack error was detected since the last read of this register. 1 = an ack error was detected since the last read of this register. crcerr ?cyclic redundancy check error the crcerr bit indicates whether or not the crc of the last transmitted or received message was valid. 0 = no crc error was detected since the last read of this register. 1 = a crc error was detected since the last read of this register. formerr ?message format error the formerr bit indicates whether or not the message format of the last transmitted or received message was correct. 0 = no format error was detected since the last read of this register. 1 = a format error was detected since the last read of this register. estat ? error and status register $yff0a0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 biterr[1:0] ack err crc err form err stuff err tx warn rx warn idle tx/rx fcs[1:0] 0 boff int err int wake int reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 table d-62 transmit bit error status biterr[1:0] bit error status 00 no transmit bit error 01 at least one bit sent as dominant was received as recessive 10 at least one bit sent as recessive was received as dominant 11 not used 336376umbook page 94 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-95 stufferr ?bit stuff error the stufferr bit indicates whether or not the bit stuffing which occurred in the last transmitted or received message was correct. 0 = no bit stuffing error was detected since the last read of this register. 1 = a bit stuffing error was detected since the last read of this register. txwarn ?transmit error status flag the txwarn status flag reflects the status of the toucan transmit error counter. 0 = transmit error counter < 96. 1 = transmit error counter 3 96. rxwarn ? receiver error status flag the rxwarn status flag reflects the status of the toucan receive error counter. 0 = receive error counter < 96. 1 = receive error counter 3 96. idle ? idle status the idle bit indicates when there is activity on the can bus. 0 = the can bus is not idle. 1 = the can bus is idle. tx/rx ? transmit/receive status the tx/rx bit indicates when the toucan module is transmitting or receiving a mes- sage. tx/rx has no meaning when idle = 1. 0 = the toucan is receiving a message if idle = 0. 1 = the toucan is transmitting a message if idle = 0. fcs[1:0] ? fault confinement state the fcs[1:0] field describes the state of the toucan. refer to table d-63 . if the softrst bit in canmcr is asserted while the toucan is in the bus off state, the error and status register is reset, including fcs[1:0]. however, as soon as the toucan exits reset, fcs[1:0] bits will again reflect the bus off state. refer to 13.4.4 error counters for more information on entry into and exit from the various fault confinement states. boffint ?bus off interrupt the boffint bit is used to request an interrupt when the toucan enters the bus off state. 0 = no bus off interrupt requested. 1 = when the toucan state changes to bus off, this bit is set, and if the boffmsk bit in canctrl0 is set, an interrupt request is generated. this interrupt is not requested after reset. table d-63 fault confinement state encoding fcs[1:0] bus state 00 error active 01 error passive 1x bus off 336376umbook page 95 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-96 user? manual errint ?error interrupt the errint bit is used to request an interrupt when the toucan detects a transmit or receive error. 0 = no error interrupt request. 1 = if an event which causes one of the error bits in the error and status register to be set occurs, the error interrupt bit is set. if the errmsk bit in canctrl0 is set, an interrupt request is generated. to clear this bit, first read it as a one, then write as a zero. writing a one has no effect. wakeint ?wake interrupt the wakeint bit indicates that bus activity has been detected while the toucan module is in low-power stop mode. 0 = no wake interrupt requested. 1 = when the toucan is in low-power stop mode and a recessive to dominant tran- sition is detected on the can bus, this bit is set. if the wakemsk bit is set in canmcr, an interrupt request is generated. d.10.13 interrupt mask register imask contains two 8-bit fields, imaskh and imaskl. imask can be accessed with a 16-bit read or write, and imaskh and imaskl can be accessed with byte reads or writes. imask contains one interrupt mask bit per buffer. it allows the cpu32 to designate which buffers will generate interrupts after successful transmission/reception. setting a bit in imask enables interrupt requests for the corresponding message buffer. d.10.14 interrupt flag register iflag contains two 8-bit fields, iflagh and iflagl. iflag can be accessed with a 16-bit read or write, and iflagh and iflagl can be accessed with byte reads or writes. iflag contains one interrupt flag bit per buffer. each successful transmission/recep- tion sets the corresponding iflag bit and, if the corresponding imask bit is set, an interrupt request will be generated. imask ? interrupt mask register $yff0a2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 imaskh imaskl reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 iflag ? interrupt flag register $yff0a4 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 iflagh iflagl reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 96 friday, november 15, 1996 2:09 pm
MC68336/376 register summary motorola user? manual d-97 to clear an interrupt flag, first read the flag as a one, and then write it as a zero. should a new flag setting event occur between the time that the cpu32 reads the flag as a one and writes the flag as a zero, the flag will not be cleared. this register can be written to zeros only. d.10.15 error counters both counters are read only, except when the toucan is in test or debug mode. rxectr ? receive error counter $yff0a6 txectr ? transmit error counter $yff0a7 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rxectr txectr reset: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336376umbook page 97 friday, november 15, 1996 2:09 pm
motorola register summary MC68336/376 d-98 user? manual 336376umbook page 98 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-1 ? ac timing (electricals) a-7 ackerr d-94 acknowledge error (ackerr) d-94 addr d-83 bus signals 5-21 definition 2-8 signal 5-25 starting address d-17 address bus (addr) 5-21 -mark wakeup 9-29 space 8-7 encoding 5-23 maps 3-14?-18 strobe (as ) 5-21 advanced microcontroller unit (amcu) literature 1-1 an 8-4, 8-5 analog front-end multiplexer 8-15 input multiplexed 8-5 port a 8-4 port b 8-4 section contents 8-1 submodule block diagram 8-12 supply pins 8-6 aps d-87 arbitration 9-3 as 5-21, 5-27, 5-30, 5-37 aspc 7-2, 7-3, d-25 asserted (definition) 2-8 atemp 4-20 auto power save (aps) d-87 avec 5-14, 5-24, 5-53, 5-58 enable bit 5-60, d-21 ? background debug mode 4-18, 5-31 commands 4-21 connector pinout 4-25 enabling 4-19 entering 4-20 registers fault address register (far) 4-22 instruction program counter (pcc) 4-22 return program counter (rpc) 4-22 returning from 4-23 serial data word 4-25 i/o block diagram 4-24 interface 4-23 peripheral interface protocol (spi) 4-24 sources 4-19 debugging mode freeze assertion diagram a-20 serial communication diagram a-20 timing a-19 base id mask bits d-93 basic operand size 5-25 baud clock 9-25 rate generator 9-2 bc d-76 bcd 4-4 beginning of queue 2 (bq2) d-35 berg connector (male) 4-25 berr 5-27, 5-31, 5-36, 5-37, 5-53 assertion results 5-35 bg 5-38, 5-58 bgack 5-38, 5-58 bgnd instruction 4-20 bh d-76 binary -coded decimal (bcd) 4-4 divider 8-24 -weighted capacitors 8-15 bit stuff error (stufferr) d-95 biterr d-94 bits d-49 encoding field 9-17 bits per transfer enable (bitse) d-54 field (bits) d-49 bitse 9-20, d-54 bit-time 9-25 biumcr d-57 biusm 10-3 freeze d-57 interrupt vector base number (vect) d-57 lpstop 10-4 registers 10-4 module configuration register (biumcr) d-57 test configuration register (biutest) d-58 time base register (biutbr) d-58 stop 10-3, d-57 biutbr d-58 index 336376umbook page 1 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-2 user? manual biutest d-58 bkpt 4-19, 5-31, 5-41, 5-50 external signal 4-20 bkpt (tpu asserted) d-76 bl d-76 blc d-75 block size (blksz) 5-58, d-17 encoding 5-59, d-17 bm d-76 bme 5-15, d-13 bmt 5-14, d-13 boffint d-95 boffmsk d-89 boot 7-3, d-25 boot rom control(boot ) d-25 bootstrap words (rombs) 7-1 boundary conditions 8-19 bp d-76 bq2 d-35 br 5-37, 5-38, 5-58 branch latch control (blc) d-75 break frame 9-25 breakpoint acknowledge cycle 5-31 asserted flag (bkpt) d-76 enable bits d-76 flag (pcbk) d-76 hardware breakpoints 5-31 instruction 4-18 mode selection 5-45 operation 5-33 software breakpoints 5-31 brushless motor commutation (comm) 11-12 bsa 4-19 bsl d-64 bt d-76 built-in emulation memory c-1 bus arbitration single device 5-39 timing diagrams active a-15 idle a-16 cycle regular 5-27 termination sequences 5-34 error exception processing 5-36 signal (berr ) 5-14, 5-23, 5-36 timing of 5-36 grant (bg ) 5-38 grant acknowledge (bgack ) 5-38 interface unit submodule. see biusm 10-1, 10-3 monitor 5-14 external enable (bme) d-13 timeout period 5-15 timing (bmt) 5-14, d-13 off interrupt (boffint) d-95 mask (boffmsk) d-89 request (br ) 5-38 select (bsl) d-64 state analyzer (bsa) 4-19 busy 13-4, 13-15 byp 8-14, d-37 bypass mode 8-14 byte (upper/lower byte option) 5-59, d-18 ? c (carry) flag 4-6, d-4 can2.0b controller module. see toucan 13-1 protocol 13-1 system 13-2 canctrl0 d-88 canctrl1 d-90 canctrl2 d-91 canicr d-88 canmcr d-85 canrx/tx pins 13-2 ccl d-76 ccr 4-6 ccw 8-1, 8-28, d-37 cf1 d-35 cf2 d-35 cfsr d-78 ch d-77, d-79, d-80 chan d-37 channel d-78 channel assignments multiplexed d-38 nonmultiplexed d-38 conditions latch (ccl) d-76 control registers 11-15 function select registers 11-15 interrupt base vector (cibv) d-77 enable /disable field (ch) d-77 and status registers 11-15 request level (cirl) d-77 status (ch) d-80 invalid d-37 number (chan) d-37 orthogonality 11-4 priority registers 11-17 register breakpoint flag (chbk) d-77 reserved d-37 chbk d-77 chip-select base address register boot rom (csbarbt) d-17 registers (csbar) 5-57, 5-58, d-17 reset values 5-63 operation 5-60 option 336376umbook page 2 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-3 register boot rom (csorbt) d-18 registers (csor) 5-57, 5-59, d-18 reset values 5-63 pin assignment registers (cspar) 5-57, d-15 field encoding 5-58, d-16 pin assignments d-16 reset operation 5-62 signals for interrupt acknowledge 5-61 timing diagram a-18 cibv d-77 cie1 d-32 cie2 d-33 cier 11-15, d-77 cirl d-77 cisr 11-13, 11-15, d-80 clear (definition) 2-8 clk d-60, d-62, d-70 clkout 5-26, 5-41 output timing diagram a-10 clkrst (clock reset) 5-41 clks d-75 clock block diagram 8-24 control multipliers 5-8 timing (electricals) a-3 generation 8-24 input pin status (fcsm) d-60 input pin status (mcsm) d-62 mode pin (modclk) 5-44 selection 5-44 output (clkout) 5-26 phase (cpha) d-49 polarity (cpol) d-49 rate selection (clk) field d-70 synthesizer control register (syncr) d-8 operation 5-5 code 13-4 cof d-59, d-61 coherency 8-6, 8-22, 11-4 comm 11-12 command ram 9-8 word pointer (cwp) d-36 common in-circuit emulator 4-19 comparator 8-16 completed queue pointer (cptqp) d-53 condition code register (ccr) 4-6, 11-5 cont d-54 contention 5-52 continue (cont) d-54 continuous transfer mode 9-6 conventions 2-8 conversion command word table (ccw) 8-1, 8-16, 8-28 cycle times 8-13 stages 8-30 counter clock select (clk) field fcsm d-60 mcsm d-62 overflow flag (cof) bit d-59, d-61 prescaler submodule. see cpsm 10-4 cpcr d-58 cpha 9-16, d-49 cpol 9-16, d-49 cpr d-79 cpsm 10-4 block diagram 10-4 registers 10-5 control register (cpcr) d-58 test register (cptr) d-59 cptqp 9-8, d-53 cptr d-59 cpu space address encoding 5-31 cycles 5-30 encoding for interrupt acknowledge 5-61 cpu32 5-40 address registers/address organization in 4-5 addressing modes 4-9 block diagram 4-2 data registers 4-4 data organization 4-5 development support 4-17 exception processing 4-15 features 3-1 generated message encoding 4-25 instructions 4-10 lpstop 4-14 movec 4-7 moves 4-7 reset 5-41 special control instructions 4-14 table lookup and interpolate (tbl) 4-14 umimplemented mc68020 instructions 4-10 loop mode 4-15 memory organization 4-7 processing states 4-9 register mnemonics 2-2 model 4-3, d-2 registers 4-2 alternate function code registers (sfc/dfc) 4-7 condition code register (ccr) 4-6, d-3 control registers 4-6 program counter (pc) 4-1 stack pointer (sp) 4-1 status register (sr) 4-6, d-3 vector base register (vbr) 4-7 virtual memory 4-9 cpu32 reference manual 4-1 cr d-54 crcerr d-94 creg d-21 336376umbook page 3 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-4 user? manual csbar d-17 csbarbt d-17 csboot 5-50, 5-56, 5-58, 7-3 reset values 5-63 csor d-18 csorbt d-18 cspar d-15 ctd9 d-62 ctm reference manual 10-1 ctm2c d-62 ctm4 address map 10-2, d-56 block diagram 10-1 bus interface unit submodule (biusm) 10-3 components 10-1 counter prescaler submodule (cpsm) 10-4 double-action submodule (dasm) 10-10 features 3-2 free-running counter submodule (fcsm) 10-5 interrupt priority and vector/pin allocation 10-18 interrupts 10-18 modulus counter submodule (mcsm) 10-5, 10-7 pulse width modulation submodule (pwmsm) 10-12 cwp d-36 cyclic redundancy check error (crcerr) d-94 ? dac 8-1 dasm 10-10 block diagram 10-11 channels 10-10 interrupts 10-12 mode flag status bit states d-64 modes of operation 10-10 registers 10-12 data register a (dasma) d-66 data register b (dasmb) d-67 status/interrupt/control register (dasmsic) d-63 timing (electricals) a-33 dasma d-66 operations d-67 dasmb d-67 operations d-68 dasmsic d-63 data 5-21 data and size acknowledge (dsack ) 5-14, 5-23 bus mode selection 5-42 signals (data) 5-21 field for rx/tx frames (toucan) 13-4 frame 9-25 multiplexer 5-25 strobe (ds ) 5-22 types 4-4 data (definition) 2-8 dbcc 4-15 dc characteristics (electricals) a-4 dcnr d-80 ddre 5-64, d-10 ddrf 5-64, d-11 ddrqa 8-2, d-30 ddrqs 9-4, 9-16, 9-19, d-47 delay after transfer (dt) 9-18, d-54 before sck (dsckl) d-50 designated cpu space 5-22 development support and test registers (tpu) 11-17 tools and support c-1 dfc 4-7 digital control section contents 8-1, 8-16?? input /output port (pqa) 8-4 port (pqb) 8-4 to analog converter (dac) 8-1, 8-15 dio 11-6 dis d-67, d-68 disabled mode 8-20 discrete input/output (dio) 11-6 distributed register (dreg) d-21 div8 clock 11-15 divide by 2/divide by 3 (div23) d-59 double -action submodule. see dasm 10-10 -buffered 9-26, 9-28 bus fault 4-20, 5-36 -row header 4-25 dreg d-21 drive time base bus (drv) d-60, d-61 drv d-60, d-61 ds 5-22, 5-27, 5-37 dsack 5-14, 5-27, 5-31, 5-53, 5-58, 5-60 assertion results 5-35 external/internal generation 5-30 option fields 5-30 signal effects 5-24 source specification in asynchronous mode 5-60, d-19 dsck d-55 dsckl d-50 dsclk 4-24 dscr d-75 dssr d-76 dt d-54 dtl d-51 dynamic bus sizing 5-24 ? ebi 5-52 eclk 5-12 bus timing a-21 output timing diagram a-10 timing diagram a-22 edge polarity (edpol) bit d-65 336376umbook page 4 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-5 edgen d-62 edgep d-62 ediv 5-12, d-8 edpol d-65 empty 13-4 emu 11-5, 11-15, d-74 emul d-25 emulation control (emu) 11-15, d-74 mode control (emul) d-25 support 11-5 en d-70 encoded one of three channel priority levels (ch) d-80 time function for each channel (channel) d-78 type of host service (ch) d-79 ending queue pointer (endqp) d-52 end-of- frame (eof) 13-16 queue condition 8-30 endqp 9-8, d-52 eof 13-16 errint d-96 errmsk d-89 error conditions 9-28 counters 13-9 detection circuitry 9-2 interrupt (errint) d-96 interrupt mask (errmsk) d-89 estat d-94 etrig 8-5 event flag (flag) d-63 event timing 11-3 exception instruction (rte) 5-36 processing 4-15, 5-40 sequence 4-17 types of exceptions 4-17 vectors 4-15 exception vector assignments 4-16 vector 5-40, 11-6 exoff d-6 ext d-9 extended message format 13-1 frames 13-4 external bus arbitration 5-38 clock division (ediv) d-8 division bit (ediv) 5-12 operation during lpstop 5-12 signal (eclk) 5-12 interface (ebi) 5-19 control signals 5-21 clock input timing diagram a-10 clock off (exoff) d-6 digital supply pin 8-6 multiplexing 8-10 reset (ext) d-9 trigger pins 8-5 externally input clock frequency d-14 multiplexed mode (mux) d-31 extrst (external reset) 5-48 ? factory test 5-64 far 4-22 fast quadrature decode (fqd) 11-12 reference 5-4 circuit 5-5 termination cycles 5-26, 5-30 read cycle timing diagram a-13 write cycle timing diagram a-14 fast reference frequency d-14 fault confinement state (fcs) 13-10, d-95 fc 5-22 fcs 13-10, d-95 fcsm 10-5 block diagram 10-5 clock sources 10-6 counter 10-6 external event counting 10-6 interrupts 10-6 registers 10-7 counter register (fcsmcnt) d-61 status/interrupt/control register (fcsmsic) d-59 time base bus drivers 10-6 timing (electricals) a-31 fcsmcnt d-61 fcsmsic d-59 fe 9-28, d-46 final sample time 8-13 flag d-63, d-68 forca d-65 forcb d-65 force (forca/b) d-65 formerr d-94 f pwm 10-16 f qclk 8-24 fqd 11-12 fqm 11-13 frame 9-25 size 9-28 frames overload 13-16 remote 13-15 framing error (fe) flag 9-28, d-46 free-running counter submodule. see fcsm 10-5 freez ack 13-16 freeze assertion response (frz) biusm 10-3, d-57 qadc 8-7, d-29 336376umbook page 5 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-6 user? manual qsm 9-3, d-41 sim 5-3 toucan d-85 tpu d-75 bus monitor (frzbm) 5-3, d-7 software enable (frzsw) 5-3, d-7 frequency control counter (y) d-8 prescaler (x) d-8 vco (w) d-8 measurement (fqm) 11-13 frz 8-7, 13-11, d-29, d-41, d-75, d-85 frzack 13-11, d-87 frzbm 5-3, d-7 frzsw 5-3, d-7 f sys 8-25, 10-16, d-8 f-term encoding 5-30 full 13-4 function code (fc) signals 5-22, 5-30 library for tpu 11-5 ? global registers 8-2 ? hall effect decode (halld) 11-13 halld 11-13 halt 13-11, d-52, d-86 halt 5-15, 5-23, 5-27, 5-37 assertion results 5-35 halt acknowledge flag (halta) d-53 monitor enable (hme) 5-15, d-13 reset (hlt) d-9 operation 5-37 negating/reasserting 5-37 qspi (halt) d-52 toucan s-clock (halt) d-86 halta d-53 halta/modf interrupt enable (hmie) bit d-52 handshaking 5-26 hang on t4 (hot4) d-75 hardware breakpoints 5-31 hlt d-9 hme 5-15, d-13 hmie d-52 host sequence registers 11-16 service registers 11-17 hot4 d-75 hsqr d-78 hssr d-79 hysteresis 5-51 ? i/o port operation 8-8 iarb biusm d-58 qadc 8-8, d-29 qsm d-41 sim 5-2, 5-3, 5-52, d-7 toucan d-88 tpu 11-5, d-75 iarb3 d-60, d-61, d-64, d-69 ic d-67, d-68 icd16/icd32 c-1 id extended (ide) field 13-5 high field 13-5 low field 13-5 i dd 5-46 ide 13-5 identifier (id) 13-1 bit field 13-6 idle 9-28, d-45, d-95 idle can status (idle) d-95 frame 9-25 -line detect type (ilt) d-43 detected (idle) 9-28, d-45 detection process 9-28 interrupt enable (ilie) 9-29, d-44 type (ilt) bit 9-29 iflag d-96 il d-60, d-61, d-64, d-69 ilie 9-29, d-44 ilqspi d-42 ilsci d-42 ilt 9-29, d-43 imask d-96 imb 8-1, 10-1 in d-60, d-64 in1 d-62 in2 d-62 in-circuit debugger (icd16/icd32) c-1 information processing time (ipt) 13-9 initial sample time 8-13 input capture/input transition counter (itc) 11-6 pin status (in) dasm d-64 sample time (ist) 8-26, d-37 interchannel communication 11-4 intermission 13-16 intermodule bus (imb) 3-3, 8-1, 10-1 internal bus error (berr ) 5-14, 5-15 monitor 5-14 clock signals (pclk) d-62 register map 3-13 interrupt 336376umbook page 6 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-7 acknowledge and arbitration 5-52 bus cycles 5-54 arbitration 5-2, 9-3 iarb field biusm d-58 qadc 8-8, d-29 qsm d-41 sim 5-2, 5-3, 5-52, d-7 toucan d-88 tpu 11-5, d-75 iarb3 bit dasm d-64 fcsm d-60 mcsm d-61 pwmsm d-69 exception processing 5-50 initializing 8-34 level (il) dasm d-64 fcsm d-60 for qspi (ilqspi) d-42 for sci (ilsci) d-42 mcsm d-61 pwmsm d-69 priority and recognition 5-51 level field (ipl) 5-60, d-20 mask (ip) field 4-6, 5-51, 9-3, 11-5, d-4 processing summary 5-53 request level (irl) bit field d-88 sources 8-32 vector base (ivb) field d-30 base address (ivba) field d-88 number 9-3 field (intv) d-42 vectors for qadc 8-33 interrupts ctm4 10-18 dasm 10-12 fcsm 10-6 mcsm 10-9 qadc 8-32 qsm 9-3 sim 5-50 toucan 13-19 tpu 11-5 inter-transfer delay 9-6 intv d-42 invalid channel number d-37 ip 9-3, 11-5 ipl d-20 ipm d-67, d-68 ipt 13-9 ipwm d-67, d-68 irl d-88 irlq1 d-29 irlq2 d-29 irq 5-51, 5-53, 11-5 i sb 6-2 ist 8-26, d-37 itc 11-6 ivb 8-33, d-30 ivba d-88 ? lbuf d-90 least significant bit (lsb) 8-15 left justified signed result word table (ljsrr) d-39 unsigned result word table (ljurr) d-39 length of delay after transfer (dtl) d-51 level-sensitivity 5-51 ljsrr d-39 ljurr d-39 load d-69 loc d-9 lock 7-3, d-25 lock /release/busy mechanism 13-15 registers (lock) d-25 logic analyzer pod connectors c-2 levels (definition) 2-8 loop d-90 loop back (loop) d-90 mode 4-15 (loops) d-43 instruction sequence 4-15 loopq d-52 loops d-43 loss of clock reset (loc) d-9 low power stop (lpstop) biusm 10-4 broadcast cycle 5-34 cpu space cycle 5-34 cpu32 4-14 interrupt mask level 5-34 mrm 7-3 qadc 8-6 qsm 9-2 sim 5-19 sram 6-2 tpu 11-15 tpuram 12-3 lowest buffer transmitted first (lbuf) d-90 low-power stop mode enable (stop) biusm d-57 mrm d-24 qadc d-28 qsm d-41 sram d-22 toucan d-85 tpu d-73 tpuram d-82 lpstop 4-14, 5-12, 5-19, 5-34, 10-4 336376umbook page 7 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-8 user? manual lr d-80 lsb 2-8, 4-4, 8-15 lsw 2-8 ? m 9-25, d-44 m68000 family compatibility 4-14 development support 4-18 m68mevb1632 c-1 modular evaluation board (mevb) c-1 m68mmds1632 c-1 mask examples for normal/extended messages 13-8 registers (rx) 13-7 masked rom module (mrm). see mrm 7-1 master /slave mode select (mstr) d-48 shift registers (tstmsr) d-21 maximum ratings (electrical) a-1 mc68010 4-14 mc68020 4-10, 4-14 mcsm 10-5, 10-7 block diagram 10-8 clock sources 10-9 counter 10-8 external event counting 10-9 interrupts 10-9 modulus latch 10-8 registers 10-10 counter register (mcsmcnt) d-63 modulus latch register (mcsmml) d-63 status/interrupt/control register (mcsmsic) d-61 time base bus drivers 10-9 timing (electricals) a-31 mcsmcnt d-63 mcsmml d-63 mcsmsic d-61 mcu basic system 5-20 block diagram 3-4 features 3-1 personality board (mpb) c-1 pin assignment package MC68336 160-pin package 3-5, b-1 mc68376 160-pin package 3-6, b-2 mechanical information b-4 memory cpu32 organization 4-7 maps overall memory 3-15 separate supervisor and user space 3-16 supervisor space (separate program/data space) 3-17 user space (separate program/data space) 3-18 virtual 4-9 message buffer address map d-85 code for rx/tx buffers 13-4 deactivation 13-13 structure 13-3 format error (formerr) d-94 mid-analog supply voltage 8-15 misaligned operand 5-25 miso 9-16, 9-19 mm 6-1, 7-1, 9-2, d-7 mmds c-1 mnemonics pin and signal 2-2 range (definition) 2-8 register 2-4 specific (definition) 2-8 modclk 5-49 mode 5-59, d-18, d-66 mode fault flag (modf) 9-9, d-53 select (m) d-44 modes disabled 8-20 reserved 8-20 scan. see scan modes modf 9-9, d-53 modular platform board c-1 module mapping (mm) bit 5-2, 6-1, 7-1, 9-2, d-6, d-7 pin functions 5-45 modulus counter 9-25 counter submodule (mcsm). see mcsm 10-5, 10-7 load edge sensitivity (edgen, edgep) bits d-62 input pin status (in1) d-62 mosi 9-16, 9-19 most significant bit (msb) 8-15 motorola microcontroller development tools directory (mcudevtldir/d rev. 3) c-1 modular development system (mmds) c-1 mpb c-1 mq1 d-32 mq2 d-33 mrm 7-1 address map d-24 array address mapping 7-1 features 3-1 low-power stop operation 7-3 normal access 7-2 registers module configuration register (mrmcr) 7-1, d-24 rom array base address registers (rom- bah/bal) 7-1, d-26 bootstrap words (rombs) 7-1, d-27 signature registers (rsighi/lo) 7-1, d-26 reset 7-3 336376umbook page 8 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-9 rom signature 7-3 mrmcr 7-1, d-24 msb 2-8, 4-4, 8-15 mstr d-48 mstrst (master reset) 5-41, 5-48, 5-50 msw 2-8 multichannel pulse width modulation (mcpwm) 11-11 multimaster operation 9-9 multiplexed analog inputs 8-5 mux 8-9, d-31 ? n (negative) flag 4-6, d-4 n clock 10-16 negated (definition) 2-8 new input capture/transition counter (nitc) 11-11 queue pointer value (newqp) d-52 newqp 9-8, 9-20, d-52 nf 9-28, d-45 nitc 11-11 noise error flag (nf) d-45 errors 9-28 flag (nf) 9-28 non-maskable interrupt 5-51 not active 13-4 not ready (notrdy) 13-3 notrdy 13-3, 13-16, d-86 n period 10-16 nrz 9-2 ? oc 11-7 ocab d-67, d-68 ocb d-67, d-68 on-chip breakpoint hardware 4-26 op (1 through 3) 5-25 opcode tracking 4-26 open drain drivers 8-4 operand alignment 5-25 byte order 5-25 destination 4-4 misaligned 5-25 source 4-4 transfer cases 5-26 operators 2-1 opwm d-67, d-68 or d-45 ordering information b-4 output compare (oc) 11-7 driver types 3-8 flip-flop 10-13 pin polarity control (pol) bit d-69 status (pin) bit d-69 overload frames 13-16 overrun 13-4 overrun error (or) d-45 ? p d-37 parallel i/o ports 5-64 parentheses (definition) 2-8 parity (pf) flag 9-28 checking 9-26 enable (pe) d-43 error (pf) bit d-46 errors 9-28 type (pt) d-43 type (pt) bit 9-26 pause (p) 8-17, d-37 pcbk d-76 pcc 4-22 pclk d-62 pclk6 d-59 pcs d-55 to sck delay (dsck) d-55 pcs0/ss 9-19 pe d-43 pepar 5-64, d-10 period /pulse width accumulator (ppwa) 11-9 and pulse width register load control (load) bit d-69 completion status (flag) bit d-68 measurement additional transition detect (pma) 11-8 missing transition detect (pmm) 11-8 periodic /interval timer 8-27 interrupt control register (picr) 5-18, d-13 modulus counter 5-17 priority 5-18 request level (pirql) 5-18, d-13 timer 5-17 components 5-17 modulus (pitm field 5-18 pit period calculation 5-18, d-14 register (pitr) d-14 timing modulus (pitm) d-14 vector (piv) 5-18, d-13 timer prescaler control (ptp) 5-17, d-14 peripheral breakpoints 4-20 chip-selects (pcs) 9-20, d-55 pf 9-28, d-46 pf1 d-35 pf2 d-35 pfpar 5-64, d-11 phase buffer segment 1/2 (pseg1/2) bit field d-92 picr 5-18, 5-53, d-13 pie1 d-32 336376umbook page 9 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-10 user? manual pie2 d-33 pin d-69 pin characteristics 3-7 electrical state 5-46 function 5-46 reset states 5-47 pirql 5-18, d-13 pitm 5-18, d-14 pitr 5-17, d-14 piv 5-18, d-13 pma 11-8 pmm 11-8 pointer 9-6 pol d-69 port parallel i/o in sim 5-64 replacement unit (pru) c-2 size 5-58 port c data register (portc) 5-60, d-15 port e data direction register (ddre) 5-64, d-10 data register (porte) 5-64, d-10 pin assignment register (pepar) 5-64, d-10 port f data direction register (ddrf) 5-64, d-11 data register (portf) 5-64, d-11 pin assignment register (pfpar) 5-64, d-11 portc d-15 porte 5-64, d-10 portf 5-64, d-11 portqa 8-2, d-30 portqb 8-2, d-30 portqs 9-4, d-46 position-synchronized pulse generator (psp) 11-8 pow d-9 power connections 3-8 consumption reduction 5-12 -up reset (pow) d-9 ppwa 11-9 pqa 8-4, 8-9 pqb 8-4, 8-9 pqspar 9-4, 9-16, 9-19, d-47 prescaler add a tick (psa) 8-25, d-31 clock (psck) d-75 high time (psh) 8-25, d-31 low time (psl) 8-25, d-31 control for tcr1 11-13 for tcr2 11-14 divide factor field d-91 register (presdiv) 13-8, d-91 division ratio select (psel) d-59 field values for qacr0 8-25 running (prun) d-58 presdiv (bit field) d-91 presdiv (register) 13-8, 13-9, d-91 program counter (pc) 4-1, 4-6 programmable channel service priority 11-4 time accumulator (pta) 11-11 transfer length 9-6 propagation segment time (propseg) d-90 propseg 13-11, d-90 pru c-2 prun d-58 psa 8-25, 8-27, d-31 psck 11-13, d-75 pseg1 d-92 pseg2 13-9, 13-11, d-92 psegs1 13-11 psel d-59 psh 8-25, d-31 psl 8-25, d-31 psp 11-8 pt 9-26, d-43 pta 11-11 ptp d-14 pulse width modulation submodule. see pwmsm 10-12 tpu waveform (pwm) 11-7 pwm 11-7 duty cycle boundary cases 10-17 pwma d-71 pwmb d-71 pwmc d-72 pwmsic d-68 pwmsm 10-12 block diagram 10-13 clock selection 10-13 coherency 10-15 counter 10-14 enable (en) d-70 output flip-flop 10-13 period registers and comparator 10-14 pulse width registers and comparator 10-15 pwm frequency 10-16 period and pulse width register values 10-17 pulse width 10-17 registers 10-17 pwm counter register (pwmc) d-72 period register (pwma) d-71 pulse width register (pwmb) d-71 status/interrupt/control register (pwmsic) d-68 timing (electricals) a-34 ? qacr0 8-2, 8-28, d-31 qacr1 8-2, 8-28, d-32 qacr2 8-2, 8-28, d-33 qadc address map d-28 336376umbook page 10 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-11 clock (qclk) 8-14 conversion characteristics (operating) a-30 electrical characteristics (operating) ac a-29 dc a-28 features 3-2 maximum ratings a-27 pin functions diagram 8-3 registers control register 0 (qacr0) 8-2, 8-28, d-31 control register 1 (qacr0) 8-2, 8-28 control register 1 (qacr1) d-32 control register 2 (qacr0) 8-2, 8-28 control register 2 (qacr2) d-33 conversion command word table (ccw) d-37 interrupt register (qadcint) 8-2, d-29 module configuration register (qadcmcr) 8-2, 8-6, d-28 port a data register (portqa) 8-2 b data register (portqb) 8-2 data direction register (ddrqa) 8-2 qa data direction register (ddrqa) d-30 qa data register (portqa) d-30 qb data register (portqb) d-30 result word table d-39 status register (qasr) 8-2, 8-28, d-35 test register (qadctest) 8-2, d-29 qadcint 8-2, d-29 qadcmcr 8-2, 8-6, d-28 qadctest 8-2, d-29 qasr 8-2, 8-28, d-35 qclk 8-14, 8-23 frequency 8-24 qdec 11-10 qilr 9-2, d-41 qivr 9-2, d-41 qom 11-11 qs d-36 qsm address map 9-2, d-40 block diagram 9-1 features 3-2 general 9-1 initialization sequence 9-30 interrupts 9-3 pin function 9-4, d-48 qspi 9-5 operating modes 9-9 operation 9-8 pins 9-8 ram 9-7 registers 9-6 reference manual 9-1 registers command ram (cr) d-54 global registers 9-2 interrupt level register (qilr) 9-2, d-41 vector register (qivr) 9-2, d-41 test register (qtest) 9-2 module configuration register (qsmcr) d-40 pin control registers 9-4 port qs data direction register (ddrqs) 9-4, d-47 data register (portqs) 9-4, d-46 pin assignment register (pqspar) d-47 qspi control register 0 (spcr0) d-48 control register 1 (spcr1) d-50 control register 2 (spcr2) d-51 control register 3 (spcr3) d-52 status register (spsr) d-52 receive data ram (rr) d-53 sci control register 0 (sccr0) d-42 control register 1 (sccr1) d-43 data register (scdr) d-46 status register (scsr) d-45 test register (qtest) d-41 transmit data ram (tr) d-54 types 9-2 sci 9-21 operation 9-24 pins 9-24 registers 9-21 qsmcr d-40 qspi 9-1, 9-5 block diagram 9-5 enable (spe) d-50 finished flag (spif) d-53 initialization operation 9-10 loop mode (loopq) d-52 master operation flow 9-11 operating modes 9-9 master mode 9-9, 9-16 wraparound mode 9-19 slave mode 9-9, 9-19 wraparound mode 9-20 operation 9-8 peripheral chip-selects 9-20 pins 9-8 ram 9-7 command ram 9-8 receive ram 9-7 transmit ram 9-7 registers 9-6 control registers 9-6 status register 9-7 timing a-23 master a-24 slave a-25 qtest 9-2, d-41 quadrature decode (qdec) 11-10 quad-word data 4-4 queue 8-16 pointers completed queue pointer (cptqp) 9-8 336376umbook page 11 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-12 user? manual end queue pointer (endqp) 9-8 new queue pointer (newqp) 9-8 status (qs) d-36 queue 1 completion flag (cf1) d-35 interrupt enable (cie1) d-32 interrupt level (irlq1) d-29 operating mode (mq1) d-32 pause flag (pf1) d-35 interrupt enable (pie1) d-32 single-scan enable (sse1) d-32 trigger overrun (tor1) d-35 queue 2 completion flag (cf2) d-35 interrupt enable (cie2) d-33 interrupt level (irlq2) d-29 operating mode (mq2) d-33 pause flag (pf2) d-35 interrupt enable (pie2) d-33 resume (res) d-34 single-scan enable bit (sse2) d-33 trigger overrun (tor2) d-36 queued analog-to-digital converter. see qadc 8-1 output match (qom) 11-11 serial module (qsm). see qsm 9-1 peripheral interface (qspi) 9-1, 9-5 ? r/w 5-22, 5-27 field 5-59, d-19 raf d-45 ram array disable (ramds) d-83 space (rasp) d-22 base address lock (rlck) bit d-22 rambah 6-1, d-23 rambal 6-1, d-23 ramds 12-1, d-83 rammcr 6-1, d-22 ramtst 6-1, d-23 rasp 6-1, d-22, d-82 encoding d-22 rdr 9-24 rdrf 9-28, d-45 re 9-28, d-44 read /write signal (r/w ) 5-22 cycle 5-28 flowchart 5-28 timing diagram a-11 system register command (rsreg) 4-20 receive data (rxd) pin 9-24 register full (rdrf) d-45 error status flag (rxwarn) d-95 pin configuration control (rxmode) d-89 ram 9-7 time sample clock (rt) 9-26, 9-28 receiver active (raf) d-45 data register (rdrf) flag 9-28 enable (re) 9-28, d-44 interrupt enable (rie) d-44 wakeup (rwu) 9-29, d-44 reception of transmitted frames 13-13 remote frames 13-15 transmission request (rtr) 13-4, 13-5 res 8-31, d-34 reserved channel number d-37 mode 8-20 reset 4-19, 5-40, 5-42, 5-46, 5-47 reset control logic in sim 5-40 exception processing 5-40 mode selection timing diagram a-18 use in determining sim configuration 5-41 module pin function out of reset 5-45 operation in sim 5-40 power-on 5-48 processing summary 5-50 source summary in sim 5-41 states of pins assigned to other mcu modules 5-47 status register (rsr) 5-14, 5-50, d-9 timing 5-47 resistor-divider chain 8-15 resolution time 8-13 result word table 8-1, 8-16, 8-31 resynchronization jump width (rjw) bit field d-91 retry operation 5-37 rie d-44 right justified, unsigned result word table (rjurr) d-39 rjurr d-39 rjw 13-11, d-91 rlck 6-1, d-22 rmc 3-7, 3-10, 3-12, 5-38 rom array space (aspc) d-25 rombah 7-1, d-26 rombal 7-1, d-26 rombs 7-1 rombs0-3 d-27 rpc 4-22 rr d-53 rs-232c terminal c-2 rsighi 7-1, 7-3, d-26 rsiglo 7-1, 7-3, d-26 rsr 5-14, d-9 rsreg 4-20 rt 9-28 336376umbook page 12 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-13 rte 5-36 rtr 13-4, 13-5, 13-15 rwu 9-29, d-44 rx length 13-4 rx14mskhi d-93 rx14msklo d-93 rx15mskhi d-93 rx15msklo d-93 rxd 9-24 rxectr d-97 rxgmskhi d-93 rxgmsklo d-93 rxmode d-89 rxwarn d-95 ? s d-4 samp d-90 sample amplifier bypass (byp) d-37 sampling mode (samp) d-90 sar 8-1, 8-16 sasm timing (electricals) a-32 sbk 9-27, d-44 scan modes scbr d-43 sccr 9-21 sccr0 d-42 sccr1 d-43 scdr 9-24, d-46 sci 9-1, 9-2, 9-16, 9-21 baud clock 9-25 rate (scbr) d-43 equation d-43 idle-line detection 9-28 internal loop 9-30 operation 9-24 parity checking 9-26 pins 9-24 receiver block diagram 9-23 operation 9-28 wakeup 9-29 registers 9-21 control registers (sccr) 9-21 data register (scdr) 9-24 status register (scsr) 9-24 transmitter block diagram 9-22 operation 9-26 sck 9-16, 9-19 actual delay before sck (equation) 9-17 baud rate (equation) 9-17 s-clock 13-8 scsr 9-24, d-45 self wake enable (selfwake) d-87 send break (sbk) 9-27, d-44 serial clock baud rate (spbr) d-49 communication interface (sci) 9-1, 9-21 formats 9-25 interface 4-23 mode (m) bit 9-25 shifter 9-24, 9-26 service request breakpoint flag (srbk) d-77 set (definition) 2-8 sfc 4-7 sglr d-80 shen 5-39, d-7 show cycle enable (shen) 5-3, 5-39, d-7 operation 5-39 timing diagram a-17 signal characteristics 3-9 functions 3-11 signature registers (rsighi/lo) 7-1 sim 5-1 address map d-5 block diagram 5-2 bus operation 5-26 chip-selects 5-54 external bus interface (ebi) 5-19 features 3-1 functional blocks 5-1 halt monitor 5-15 interrupt arbitration 5-3 interrupts 5-50 low-power stop operation 5-19 module configuration register (simcr) d-6 parallel i/o ports 5-64 periodic interrupt timer 5-17 block diagram (with software watchdog) 5-17 register access 5-3 registers chip-select base address register boot rom (csbarbt) d-17 registers (csbar) 5-57, 5-58, d-17 option register boot rom (csorbt) d-18 registers (csor) 5-57, 5-59, d-18 pin assignment registers (cspar) 5-57, d-15 clock synthesizer control register (syncr) d-8 distributed register (dreg) d-21 master shift register a/b (tstmsra/b) d-21 module configuration register (simcr) 5-2 periodic interrupt control register (picr) d-13 timer register (pitr) 5-17, d-14 port c data register (portc) 5-60, d-15 port e data direction register (ddre) 5-64, d-10 data register (porte) 5-64, d-10 pin assignment register (pepar) 5-64, 336376umbook page 13 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-14 user? manual d-10 port f data direction register (ddrf) 5-64, d-11 data register (portf) 5-64, d-11 pin assignment register (pfpar) 5-64, d-11 reset status register (rsr) d-9 software service register (swsr) d-14 system integration test register - eclk (simtre) d-9 test register (simtr) d-7 protection control register (sypcr) d-12 test module repetition count (tstrc) d-21 shift count register (tstsc) d-21 submodule control register (creg) d-21 reset 5-40 state of pins 5-46 software watchdog 5-15 block diagram (with pit) 5-15 spurious interrupt monitor 5-15 system clock 5-4 block diagram 5-4 synthesizer operation 5-5 configuration 5-2 protection 5-14 sim reference manual 5-54 simcr 5-2, 9-2, 12-1, d-6 simtr d-7 simtre d-9 siz 5-22, 5-25, 5-40 size signals (siz) 5-22 encoding 5-22 slave select signal (ss ) 9-19 slock d-8 sm 11-9 smb 10-1 sof 13-9 soft reset (softrst) d-86 softrst 13-11, d-86 software breakpoints 5-31 service register (swsr) d-14 watchdog 5-15 block diagram 5-17 clock rate 5-16 enable (swe) d-12 enable (swe) bit 5-15 prescale (swp) d-12 prescale (swp) bit 5-16 ratio of swp and swt bits 5-16 reset (sw) d-9 timeout period calculation 5-16 timing field (swt) 5-16, d-12 space (address space select) 5-60, d-20 spbr d-49 spcr0 d-48 spcr1 d-50 spcr2 d-51 spcr3 d-52 spe 9-6, d-50 spi 4-24 finished interrupt enable (spifie) d-51 spif d-53 spifie d-51 spsr d-52 spwm 11-7 sr 4-6 sram address map d-22 array address mapping 6-1 features 3-1 normal access 6-2 registers array base address register high (rambah) 6-1, d-23 low (rambal) 6-1, d-23 module configuration register (rammcr) 6-1, d-22 test register (ramtst) 6-1, d-23 reset 6-3 standby and low-power stop operation 6-2 srbk d-77 srr 13-5 ss 9-19, 9-20 sse1 d-32 sse2 d-33 ssp 4-10 stack pointer (sp) 4-1 standard message format 13-1 frames 13-4 nonreturn to zero (nrz) 9-2 standby ram module w/ tpu emulation (tpuram). see tpuram 12-1 start bit (beginning of data frame) 9-25 -of-frame (sof) symbol 13-9 state machine 8-24, 9-28 stepper motor (sm) 11-9 stext 5-12, d-9 stf d-75 stop 13-17, d-22, d-24, d-28, d-41, d-57, d-73, d-82, d-85 stop acknowledge (stopack) d-87 clocks to tcrs (clks) d-75 enable (stop) bit biusm 10-3 qadc 8-6 qsm 9-2 sram 6-2 toucan 13-17 tpu 11-15 flag (stf) d-75 mode external clock (stext) 5-12, d-9 336376umbook page 14 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-15 sim clock (stsim) 5-12, d-8 sci end of data frame bit 9-25 stopack d-87 strb (address strobe/data strobe) bit 5-30, 5-60, d-19 stsim 5-12, d-8 stufferr d-95 submodule bus (smb) 10-1 subqueue 8-17 substitute remote request (srr) 13-5 successive approximation register (sar) 8-1, 8-16 supervisor /unrestricted data space (supv) cpu32 d-4 qadc d-29 qsm d-41 sim 5-3, d-7 toucan d-87 tpu d-75 stack pointer (ssp) 4-10 supv 5-3, 8-8, d-29, d-41, d-87 sw d-9 swe 5-15, d-12 swp 5-16, d-12 swsr d-14 swt 5-16, d-12 symbols 2-1 synchronized pulse width modulation (spwm) 11-7 syncr d-8 synthesizer lock flag (slock) d-8 sypcr d-12 sys d-9 sysrst (system reset) 5-41 system clock 5-4 block diagram 5-4 output (clkout) 5-26 sources 5-4 frequencies 5-10 integration module. see sim 5-1, d-5 test register - eclk (simtre) d-9 memory maps. see memory maps 3-14 protection control register (sypcr) d-12 reset (sys) d-9 ? t d-3 t2cg 11-14, d-74 table stepper motor (tsm) 11-10 tbb 10-1 tbl 4-14 tbrs1 d-58 tbrs2 d-58 tc 9-27, d-45 tcie 9-27, d-44 tcr d-75 tcr1p 11-13, d-74 tcr2 clock/gate control (t2cg) d-74 tcr2p d-74 tdr 9-24 tdre 9-27, d-45 te d-44 temporary register a (atemp) 4-20 test module repetition count (tstrc) d-21 shift count register (tstsc) d-21 submodule control register (creg) d-21 reset (tst) d-9 thermal characteristics a-2 three-state control (tsc) 5-49 ticr 11-13, d-77 tie 9-27, d-44 time base bus driver for mcsm 10-9 buses (tbb) 10-1, 10-2 allocation 10-3 register bus select bits (tbrs1/0) d-58 processor unit. see tpu 11-1 quanta clock 13-8 stamp 13-4, 13-10 timer d-92 timer count register 1 prescaler control (tcr1p) d-74 2 prescaler control (tcr2p) d-74 synchronize mode (tsync) d-90 tor1 d-35 tor2 d-36 toucan address map d-84 space 13-2 bit timing configuration 13-8 operation 13-9 block diagram 13-1 disable (frzack) d-87 external pins 13-2 features 3-3 function 13-1 initialization sequence 13-11 interrupts 13-19 message buffer address map d-85 not ready (notrdy) d-86 operation 13-3 receive process 13-13 registers control register 0 (canctrl0) d-88 control register 1 (ctrl1) 13-8 control register 1(canctrl1) d-90 control register 2 (canctrl2) d-91 control register 2 (ctrl2) 13-8 error and status register (estat) d-94 free running timer register (timer) d-92 interrupt configuration register (canicr) d-88 flag register (iflag) d-96 336376umbook page 15 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-16 user? manual mask register (imask) d-96 module configuration register (canmcr) d-85 receive buffer 14 mask registers (rx14mskhi/lo) d-93 buffer 15 mask registers (rx15mskhi/lo) d-93 global mask registers (rxgmsklo/hi d-93 rx/tx error counter registers (rxectr/txec- tr) d-97 test configuration register (cantcr) d-88 special operating modes 13-16 auto power save mode 13-18 debug mode 13-16 low-power stop mode 13-17 transmit process 13-12 tpu a mask functions 11-6 discrete input/output (dio) 11-6 input capture/input transition counter (itc) 11-6 output compare (oc) 11-7 period /pw accumulator (ppwa) 11-9 measurement add transition detect (pma) 11-8 missing transition detect (pmm) 11-8 position-synch pulse generator (psp) 11-8 pulse width modulation (pwm) 11-7 quadrature decode (qdec) 11-10 stepper motor (sm) 11-9 synch pw modulation (spwm) 11-7 address map d-73 block diagram 11-1 components 11-2 features 3-2 freeze flag (tpuf) d-77 function library 11-5 g mask functions 11-10 brushless motor commutation (comm) 11-12 fast quadrature decode (fqd) 11-12 frequency measurement (fqm) 11-13 hall effect decode (halld) 11-13 multichannel pulse width modulation (pcpwm) 11-11 new input capture/transition counter (nitc) 11-11 programmable time accumulator (pta) 11-11 queued output match (qom) 11-11 table stepper motor (tsm) 11-10 universal asynchronous receiver/transmitter (uart) 11-12 host interface 11-3 interrupts 11-5 microengine 11-3 operation 11-3 coherency 11-4 emulation support 11-5 event timing 11-3 interchannel communication 11-4 programmable channel service priority 11-4 overview 11-1 parameter ram 11-3, d-80 address map d-81 registers channel function select registers (cfsr) d-78 interrupt enable register (cier) 11-5, d-77 status register (cisr) 11-5, d-80 priority registers (cpr) d-79 decoded channel number register (dcnr) d-80 development support control register (dscr) d-75 support status register (dssr) d-76 host sequence registers (hsqr) d-78 service request registers (hssr) d-79 link register (lr) d-80 module configuration register (tpumcr) d-73 service grant latch register (sglr) d-80 test configuration register (tcr) d-75 tpu interrupt configuration register (ticr) d-77 scheduler 11-3 time bases 11-2 timer channels 11-2 timing (electricals) a-26 tpu reference manual 11-3, 11-16, 11-17 tpuf d-77 tpumcr 11-13, d-73 tpuram address map d-82 array address mapping 12-1 base address (addr) d-83 space (rasp) d-82 features 3-2 general 12-1 operation normal 12-2 standby 12-2 privilege level 12-2 register block 12-1 registers base address and status register (trambar) d-82 module configuration register (trammcr) d-82 test register (tramtst) d-82 reset 12-3 tpu microcode emulation 12-3 t pwmax 10-17 t pwmin 10-17 tr d-54 trace enable field (t) d-3 on instruction execution 4-18 trambar 12-1, d-82 trammcr 12-1, d-82 336376umbook page 16 friday, november 15, 1996 2:09 pm
MC68336/376 motorola user? manual i-17 tramtst 12-1, d-82 transfer length options 9-17 time 8-13 transistion-sensitivity 5-51 transmission complete (tc) flag 9-27 interrupt enable (tcie) 9-27 transmit /receive status (tx/rx ) d-95 bit error (biterr) d-94 complete bit (tc) d-45 interrupt enable (tcie) d-44 data (txd) pin 9-24 register empty (tdre) flag 9-27, d-45 error status flag (txwarn) d-95 interrupt enable (tie) 9-27, d-44 pin configuration control (txmode) d-89 ram 9-7 transmitter enable (te) 9-26, d-44 trigger event 8-30 tsc 5-49 tsm 11-10 t sr 8-6 tst d-9 tstme 3-8, 3-10, 3-12 tstmsr d-21 tstrc d-21 tstsc d-21 tsync d-90 tx length 13-4 tx/rx d-95 txd 9-24 txectr d-97 txmode d-89 txwarn d-95 typical ratings (electrical) a-2 ? uart 11-12 unimplemented instruction emulation 4-18 universal asynchronous receiver/transmitter (uart) 11-12 user stack pointer (usp) 4-10 using the tpu function library and tpu emulation mode 11-5 usp 4-10 ? v (overflow) flag 4-6, d-4 variable pulse width signal generator (prescaler) 8-25 vbr 4-7, 4-15 v dd 3-8, 5-48, 6-1, 8-6, 12-1 ramp time 5-48 v dda 3-8, 8-6 v dda/2 8-15 v ddsyn 3-8, 5-48 vect d-57 vector base register (vbr) 3-14, 4-7, 4-15, 5-50 v ih 8-8 v il 8-8 virtual memory 4-9 voltage controlled oscillator (vco) frequency ramp time 5-48 reference pins 8-5 v pp c-2 v rh 3-8, 8-5, 8-15, d-37 v rl 3-8, 8-5, 8-15, d-37 v ss 3-8, 8-6, 12-2 v ssa 3-8, 8-6 v stby 3-8, 6-2, 12-1, 12-2 ? w bit d-8 wait 7-3, d-25 wait states (wait) d-25 wake 9-29, d-44 wake interrupt (wakeint) d-96 wakeint 13-17, d-96 wakemsk 13-17, d-86 wakeup address mark (wake) 9-29, d-44 functions 9-2 interrupt mask (wakemsk) d-86 wired-or mode for qspi pins (womq) d-48 for sci pins (woms) 9-26, d-43 mode (wor) d-64 womq d-48 woms 9-26, d-43 wor d-64 wrap enable (wren) d-51 to (wrto) d-51 wraparound mode 9-6 master 9-19 slave 9-20 wren d-51 write cycle 5-29 flowchart 5-29 timing diagram a-12 wrto d-51 ? x (extend) flag 4-6, d-4 bit in syncr d-8 xtrst (external reset) 5-41 336376umbook page 17 friday, november 15, 1996 2:09 pm
motorola MC68336/376 i-18 user? manual ? y field d-8 ? z (zero) flag 4-6, d-4 336376umbook page 18 friday, november 15, 1996 2:09 pm


▲Up To Search▲   

 
Price & Availability of MC68336

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X